blob: c4ee8179142c66c35be6df7a7a8bb253abee49ef [file] [log] [blame]
Brian Silvermanaf784862014-05-13 08:14:55 -07001This directory has replacements for some libc functions that we don't want to
2use because they're not thread-safe and/or they allocate memory.
3
4Some of them are implemented as C++ functions because it makes fixing the
5memory management issues that cause the standard versions to be not thread-safe
6possible and some of them are still callable from C when it makes sense.
7
8<http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_01>
9has a list of the not-thread-safe POSIX functions. We've gotten rid of all of
10those except for the following:
11 getenv(3): <http://austingroupbugs.net/view.php?id=188> proposes changing
12 POSIX to require it to return a pointer into environ, making it thread-safe,
13 which glibc already does.
14 inet_ntoa(3): Glibc uses a thread-local buffer, which makes it thread-safe,
15 and uses of this function should go away soon.
16 readdir(3): Glibc already guarantees that only invocations on the same
17 directory stream aren't thread-safe, and there's talk of changing POSIX to
18 say the same thing.