diff options
| author | Julian Elischer <julian@FreeBSD.org> | 1996-01-22 00:02:33 +0000 |
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 1996-01-22 00:02:33 +0000 |
| commit | f70177e76e605ec6e6cd5b938fa77ade5d380e87 (patch) | |
| tree | a89c7f50ec371cef4418259b9dccdd31ebb2f61f /lib/libc/stdio/putc.c | |
| parent | 61de51cad66df0d565233915f856932159d33a4a (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/putc.c')
| -rw-r--r-- | lib/libc/stdio/putc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/stdio/putc.c b/lib/libc/stdio/putc.c index c18353b7044a..f1d42b11454b 100644 --- a/lib/libc/stdio/putc.c +++ b/lib/libc/stdio/putc.c @@ -39,15 +39,28 @@ static char sccsid[] = "@(#)putc.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> +#ifdef _THREAD_SAFE +#include <pthread.h> +#include "pthread_private.h" +#endif /* * A subroutine version of the macro putc. */ #undef putc +int putc(c, fp) int c; register FILE *fp; { - return (__sputc(c, fp)); + int retval; +#ifdef _THREAD_SAFE + _thread_flockfile(fp,__FILE__,__LINE__); +#endif + retval = __sputc(c, fp); +#ifdef _THREAD_SAFE + _thread_funlockfile(fp); +#endif + return (retval); } |
