svn commit: r357419 - in head: include lib/libc/stdio
Kyle Evans
kevans at FreeBSD.org
Sun Feb 2 19:45:13 UTC 2020
Author: kevans
Date: Sun Feb 2 19:45:12 2020
New Revision: 357419
URL: https://svnweb.freebsd.org/changeset/base/357419
Log:
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
Modified:
head/include/stdio.h
head/lib/libc/stdio/Symbol.map
head/lib/libc/stdio/fputc.c
Modified: head/include/stdio.h
==============================================================================
--- head/include/stdio.h Sun Feb 2 19:16:52 2020 (r357418)
+++ head/include/stdio.h Sun Feb 2 19:45:12 2020 (r357419)
@@ -348,6 +348,7 @@ int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fflush_unlocked(FILE *);
int fileno_unlocked(FILE *);
+int fputc_unlocked(int, FILE *);
int fputs_unlocked(const char * __restrict, 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,
Modified: head/lib/libc/stdio/Symbol.map
==============================================================================
--- head/lib/libc/stdio/Symbol.map Sun Feb 2 19:16:52 2020 (r357418)
+++ head/lib/libc/stdio/Symbol.map Sun Feb 2 19:45:12 2020 (r357419)
@@ -173,6 +173,7 @@ FBSD_1.5 {
FBSD_1.6 {
fflush_unlocked;
+ fputc_unlocked;
fputs_unlocked;
fread_unlocked;
fwrite_unlocked;
Modified: head/lib/libc/stdio/fputc.c
==============================================================================
--- head/lib/libc/stdio/fputc.c Sun Feb 2 19:16:52 2020 (r357418)
+++ head/lib/libc/stdio/fputc.c Sun Feb 2 19:45:12 2020 (r357419)
@@ -47,13 +47,21 @@ __FBSDID("$FreeBSD$");
#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
fputc(int c, FILE *fp)
{
int retval;
+
FLOCKFILE_CANCELSAFE(fp);
- /* Orientation set by __sputc() when buffer is full. */
- /* ORIENT(fp, -1); */
- retval = __sputc(c, fp);
+ retval = fputc_unlocked(c, fp);
FUNLOCKFILE_CANCELSAFE();
return (retval);
}
More information about the svn-src-head
mailing list