From accd7f182e87d2a1d578214211ee7ded32753803 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Mon, 3 Jun 1996 05:12:29 +0000 Subject: Phase 2 of merge - also fix things broken in phase 1. Watch out for falling rock until phase 3 is over! libc completely merged except for phkmalloc & rfork (don't know if David wants that). Some include files in sys/ had to be updated in order to bring in libc. --- lib/libc/stdio/putchar.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdio/putchar.c') 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 +#ifdef _THREAD_SAFE +#include +#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); } -- cgit v1.2.3