NetBSD/lib/libpthread/stdio
proven b1fc22f93a Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
..
Makefile.inc Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
README Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
clrerr.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fclose.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fdopen.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
feof.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
ferror.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fflush.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fgetc.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fgetline.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fgetpos.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fgets.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fileno.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
findfp.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
flags.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
floatio.h Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fopen.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fpurge.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fputc.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fputs.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fread.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
freopen.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fscanf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fseek.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fsetpos.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
ftell.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
funopen.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fvwrite.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fvwrite.h Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fwalk.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
fwrite.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
getc.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
getc_unlocked.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
getchar.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
getchar_unlocked.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
gets.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
getw.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
glue.h Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
local.h Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
makebuf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
mktemp.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
perror.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
perror.c.old Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
printf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
putc.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
putc_unlocked.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
putchar.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
putchar_unlocked.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
puts.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
putw.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
refill.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
remove.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
rewind.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
rget.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
scanf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
setbuf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
setbuffer.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
setvbuf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
snprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
sprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
sscanf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
stdio.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
strerror.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
tempnam.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
tmpfile.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
tmpnam.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
ungetc.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vfprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vfscanf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vscanf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vsnprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vsprintf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
vsscanf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
wbuf.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00
wsetup.c Add one complete thread safe stdio. 1994-02-07 22:05:21 +00:00

README

This is a threadsafe stdio based on the BSD stdio written by Chris Torek.

INCLUDE FILES AND PORTING
To continue to make this package portable, some basic rules on includes
files must be followed.

pthread.h should be included first (if it is to be included).
stdio.h should be included.

INTERNAL LOCKING
1.	All functions that can be called by the user must have __flockfile at the
	begining and a __funlockfile at the end. __Flockfile is a counting mutex,
	The thread that owns the lock can call __flockfile as many times as
	it wants, but must call an equal number of __funlockfile before the
	lock will be released.
2.	All functions starting with __ shouldn't need addtional locking.
3.	Anything that writes the variable __sglue should lock __sfp_mutex,
 	check __sfp_state, and do a condion wait if it is set.
4.	Anything that checks fp->_flag for valididity should also lock
	__sfp_mutex.
5.	Anything that reads the variable __sglue should lock __sfp_mutex, increment
	__sfp_state, and then unlock the mutex. At function return it should
	lock the mutex again decrement __sfp_state and check if zero. If so
	do a cond_signal, and unlock the mutex.
6.	The functions fopen, fdopen, and freopen are the only functions that
	will change a fp->_file
7.	fdopen and fopen both allocate the next fp by locking __sfp_mutex
	checking fp->_flags and then setting it if free.
8.	freopen tries to preserve fp->_file. It sets __sfp_mutex, then it
	tries to lock fp->_file and close it.
9.	__sinit is done with a pthread_once routine.

Copyright (c) 1993 Chris Provenzano. All rights reserved.

This product includes software developed by the Univeristy of California,
Berkeley and its contributors.


Things to do.
Fix printf so it uses the ininf function.