diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-09-13 03:21:39 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-09-13 03:21:39 +0000 |
commit | fafaa44ef0176da243b19e4d68bf2ffc3bbb4f88 (patch) | |
tree | 33499236a84d75a7c87657aaa18602c9db05d697 /stdio-common | |
parent | ae2ddc98c17c17897398c8d960d984789ecab0d9 (diff) | |
download | glibc-fafaa44ef0176da243b19e4d68bf2ffc3bbb4f88.tar.gz glibc-fafaa44ef0176da243b19e4d68bf2ffc3bbb4f88.tar.xz glibc-fafaa44ef0176da243b19e4d68bf2ffc3bbb4f88.zip |
update from main archive 960912
Fri Sep 13 04:33:08 1996 Ulrich Drepper <drepper@cygnus.com> * sched.h: New file. helper to access posix/sched.h. * posix/sched.h: Change `sched_params' to `sched_param' to follow POSIX.4. Thu Sep 12 20:12:40 1996 Ulrich Drepper <drepper@cygnus.com> * db/makedb.c (usage): Print bug report address separately to ease translators task. * catgets/gencat.c (usage): Likewise. * locale/locale.c (usage): Likewise. * locale/localedef.c (usage): Likewise. 1996-09-12 Paul Eggert <eggert@twinsun.com> * time/strftime.c (my_localtime_r): Define if ! HAVE_LOCALTIME_R, and #define localtime_r to it. If _LIBC, use __localtime_r instead. (my_gmtime_r): Similar, except it's not needed if ! HAVE_TM_GMTOFF. Thu Sep 12 14:03:29 1996 Ulrich Drepper <drepper@cygnus.com> * crypt/Makefile: Include Makeconfig and add crypt object dir to rpath-link so that running the check finds the new library. * crypt/cert.c: provide correct prototypes to prevent warnings. Reported by Andreas Jaeger. * sysdeps/mach/hurd/Makefile (rpath-link): Don't use += because old and new value must be glued using `:'. Reported by Marcus Daniels.
Diffstat (limited to 'stdio-common')
-rw-r--r-- | stdio-common/Makefile | 5 | ||||
-rw-r--r-- | stdio-common/vfprintf.c | 21 |
2 files changed, 16 insertions, 10 deletions
diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 7fe1987158..4b9ec71338 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -33,6 +33,11 @@ routines := \ tmpfile tmpnam tempnam tempname \ getline getw putw \ remove rename + +ifneq (,$(filter %REENTRANT, $(defines))) +routines += lockfile +endif + aux := errlist siglist distribute := _itoa.h printf-parse.h diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index dc2983d264..1316adacbf 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -124,8 +124,6 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n)); } \ while (0) # define UNBUFFERED_P(s) ((s)->__buffer == NULL) -# define __flockfile(S) /* nothing */ -# define __funlockfile(S) /* nothing */ #endif /* USE_IN_LIBIO */ @@ -155,6 +153,14 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n)); #endif +#ifdef _LIBC_REENTRANT +extern void __flockfile (FILE *); +weak_extern (__flockfile); +extern void __funlockfile (FILE *); +weak_extern (__funlockfile); +#endif + + /* Global variables. */ static const char null[] = "(null)"; @@ -848,15 +854,10 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) f = lead_str_end = find_spec (format, &mbstate); /* Lock stream. */ -#ifdef USE_IN_LIBIO - __libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s); -#else -#if 0 - /* XXX For now stdio has no locking. */ __libc_cleanup_region_start ((void (*) (void *)) &__funlockfile, s); -#endif -#endif - __flockfile (s); + + if (__flockfile != NULL) + __flockfile (s); /* Write the literal text before the first format. */ outstring ((const UCHAR_T *) format, |