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/putchar.c | |
| parent | 61de51cad66df0d565233915f856932159d33a4a (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/putchar.c')
| -rw-r--r-- | lib/libc/stdio/putchar.c | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/stdio/putchar.c b/lib/libc/stdio/putchar.c index 036b8970772c..5e04a6c72f2c 100644 --- a/lib/libc/stdio/putchar.c +++ b/lib/libc/stdio/putchar.c @@ -39,16 +39,29 @@ static char sccsid[] = "@(#)putchar.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  #undef putchar  /*   * A subroutine version of the macro putchar   */ +int  putchar(c)  	int c;  { +	int retval;  	register FILE *so = stdout; -	return (__sputc(c, so)); +#ifdef _THREAD_SAFE +	_thread_flockfile(so,__FILE__,__LINE__); +#endif +	retval = __sputc(c, so); +#ifdef _THREAD_SAFE +	_thread_funlockfile(so); +#endif +	return (retval);  }  | 
