CVSROOT: /cvs Module name: src Changes by: k...@cvs.openbsd.org 2009/11/08 17:18:28
Modified files: include : stdio.h lib/libpthread/uthread: uthread_file.c lib/libc/gen : getgrent.c getgrouplist.c getttyent.c lib/libc/stdio : asprintf.c clrerr.c fclose.c feof.c ferror.c fflush.c fgetc.c fgetln.c fgets.c fgetwc.c fgetws.c fileno.c findfp.c fpurge.c fputc.c fputs.c fputwc.c fputws.c fread.c freopen.c fseek.c ftell.c fvwrite.c fwalk.c fwide.c fwrite.c getc.c gets.c local.h putc.c puts.c putw.c refill.c setvbuf.c snprintf.c sprintf.c ungetc.c ungetwc.c vasprintf.c vfprintf.c vfscanf.c vsnprintf.c vsprintf.c wbuf.c Log message: Fix the handle locking in stdio to use flockfile/funlockfile internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.