avoid using pthread cleanup push/pop in stdio when not needed
authorRich Felker <dalias@aerifal.cx>
Sat, 26 May 2012 02:44:34 +0000 (22:44 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 26 May 2012 02:44:34 +0000 (22:44 -0400)
commit3f25354e624361f40011b242c492c2118184cc44
treefbfebdbc6dd45cd6f7fb4307ff553c6b41567647
parent8cce15af83c04d8965561439f0a80a451a9b1af0
avoid using pthread cleanup push/pop in stdio when not needed

unfortunately in dynamic-linked programs, these macros cause
pthread_self to be initialized, which costs a couple syscalls, and
(much worse) would necessarily fail, crash, and burn on ancient (2.4
and earlier) kernels where setting up a thread pointer does not work.

i'd like to do this in a more generic way that avoids all use of
cleanup push/pop before pthread_self has been successfully called and
avoids ugly if/else constructs like the one in this commit, but for
now, this will suffice.
src/stdio/__stdio_read.c
src/stdio/__stdio_write.c