platform_bionic/libc/stdio
Kenny Root f582340a6a Fix the handle locking in stdio
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.

Based on OpenBSD change by guenther@openbsd.org
http://www.mail-archive.com/source-changes@cvs.openbsd.org/msg01015.html

Bug: 3446659
Change-Id: Ie82116e358c541718d6709ec45ca6796be5a007b
2011-02-14 09:32:56 -08:00
..
asprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
clrerr.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fclose.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fdopen.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
feof.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
ferror.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fflush.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fgetc.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fgetln.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fgetpos.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fgets.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fileext.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fileno.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
findfp.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
flags.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
floatio.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
flockfile.c stdio: make internal symbols static/hidden 2010-10-15 01:10:31 +08:00
fopen.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
fprintf.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
fpurge.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fputc.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fputs.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fread.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
freopen.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fscanf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fseek.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fsetpos.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ftell.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
funopen.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fvwrite.c Bug 3330205 Put blanks and zeroes in const area 2011-01-09 11:38:56 -08:00
fvwrite.h Bug 3330205 Put blanks and zeroes in const area 2011-01-09 11:38:56 -08:00
fwalk.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
fwrite.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
getc.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
getchar.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
gets.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
glue.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
local.h Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
makebuf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
mktemp.c stdio: make internal symbols static/hidden 2010-10-15 01:10:31 +08:00
printf.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
putc.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
putchar.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
puts.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
putw.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
refill.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
remove.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
rewind.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
rget.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
scanf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
setbuf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
setbuffer.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
setvbuf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
snprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
sprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
sscanf.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
stdio.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
tempnam.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
tmpfile.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
tmpnam.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ungetc.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
vasprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
vfprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
vfscanf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
vprintf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
vscanf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
vsnprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
vsprintf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
vsscanf.c improve readability of stdio: fix indentation and remove trailing spaces 2010-05-17 09:34:13 -07:00
wbuf.c Fix the handle locking in stdio 2011-02-14 09:32:56 -08:00
wcio.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
wsetup.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00