libc: provide fputc_unlocked
Among the same justification as the other stdio _unlocked; in addition to an inline version in <stdio.h>, we must provide a function in libc as well for the functionality. This fixes the lang/gcc* builds, which want to use the symbol from libc. PR: 243810 Reported by: antoine, swills, Michael <michael.adm gmail com> X-MFC-With: r357284
This commit is contained in:
parent
469026a8a3
commit
b85ea80975
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=357419
@ -348,6 +348,7 @@ int feof_unlocked(FILE *);
|
|||||||
int ferror_unlocked(FILE *);
|
int ferror_unlocked(FILE *);
|
||||||
int fflush_unlocked(FILE *);
|
int fflush_unlocked(FILE *);
|
||||||
int fileno_unlocked(FILE *);
|
int fileno_unlocked(FILE *);
|
||||||
|
int fputc_unlocked(int, FILE *);
|
||||||
int fputs_unlocked(const char * __restrict, FILE * __restrict);
|
int fputs_unlocked(const char * __restrict, FILE * __restrict);
|
||||||
size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict);
|
size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict);
|
||||||
size_t fwrite_unlocked(const void * __restrict, size_t, size_t,
|
size_t fwrite_unlocked(const void * __restrict, size_t, size_t,
|
||||||
|
@ -173,6 +173,7 @@ FBSD_1.5 {
|
|||||||
|
|
||||||
FBSD_1.6 {
|
FBSD_1.6 {
|
||||||
fflush_unlocked;
|
fflush_unlocked;
|
||||||
|
fputc_unlocked;
|
||||||
fputs_unlocked;
|
fputs_unlocked;
|
||||||
fread_unlocked;
|
fread_unlocked;
|
||||||
fwrite_unlocked;
|
fwrite_unlocked;
|
||||||
|
@ -46,14 +46,22 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#undef fputc_unlocked
|
#undef fputc_unlocked
|
||||||
|
|
||||||
|
int
|
||||||
|
fputc_unlocked(int c, FILE *fp)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* Orientation set by __sputc() when buffer is full. */
|
||||||
|
/* ORIENT(fp, -1); */
|
||||||
|
return (__sputc(c, fp));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
fputc(int c, FILE *fp)
|
fputc(int c, FILE *fp)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
FLOCKFILE_CANCELSAFE(fp);
|
FLOCKFILE_CANCELSAFE(fp);
|
||||||
/* Orientation set by __sputc() when buffer is full. */
|
retval = fputc_unlocked(c, fp);
|
||||||
/* ORIENT(fp, -1); */
|
|
||||||
retval = __sputc(c, fp);
|
|
||||||
FUNLOCKFILE_CANCELSAFE();
|
FUNLOCKFILE_CANCELSAFE();
|
||||||
return (retval);
|
return (retval);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user