From 0d07ad302a237f3f5fefffdc052cb8d7d3a07b2b Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 12 May 2008 22:20:30 +0000 Subject: [PATCH] Add list of thread-safe functions. --- man7/pthreads.7 | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/man7/pthreads.7 b/man7/pthreads.7 index 8fe7f7068..df2eb5964 100644 --- a/man7/pthreads.7 +++ b/man7/pthreads.7 @@ -106,6 +106,110 @@ capabilities (see .IP \- 3 CPU affinity .RB ( sched_setaffinity (2)) +.SS "Thread-safe functions" +A thread-safe function is one that can be safely +(i.e., it will deliver the same results regardless of whether it is) +called from multiple threads at the same time. + +POSIX.1-2001 requires that all functions specified in the standard +shall be thread-safe, except for the following functions: +.\" FIXME . SUSv4 removes ecvt(), fcvt(), gcvt(), gethostbyname(), and +.\" gethostbyaddr(), since they are removed from the standard, and +.\" and adds strerror() and system(). +.in +4n +.nf + +asctime() +basename() +catgets() +crypt() +ctermid() if passed a non-NULL argument +ctime() +dbm_clearerr() +dbm_close() +dbm_delete() +dbm_error() +dbm_fetch() +dbm_firstkey() +dbm_nextkey() +dbm_open() +dbm_store() +dirname() +dlerror() +drand48() +ecvt() +encrypt() +endgrent() +endpwent() +endutxent() +fcvt() +ftw() +gcvt() +getc_unlocked() +getchar_unlocked() +getdate() +getenv() +getgrent() +getgrgid() +getgrnam() +gethostbyaddr() +gethostbyname() +gethostent() +getlogin() +getnetbyaddr() +getnetbyname() +getnetent() +getopt() +getprotobyname() +getprotobynumber() +getprotoent() +getpwent() +getpwnam() +getpwuid() +getservbyname() +getservbyport() +getservent() +getutxent() +getutxid() +getutxline() +gmtime() +hcreate() +hdestroy() +hsearch() +inet_ntoa() +l64a() +lgamma() +lgammaf() +lgammal() +localeconv() +localtime() +lrand48() +mrand48() +nftw() +nl_langinfo() +ptsname() +putc_unlocked() +putchar_unlocked() +putenv() +pututxline() +rand() +readdir() +setenv() +setgrent() +setkey() +setpwent() +setutxent() +strerror() +strtok() +tmpnam() if passed a non-NULL argument +ttyname() +unsetenv() +wcrtomb() if its final argument is NULL +wcsrtombs() if its final argument is NULL +wcstombs() +wctomb() +.fi +.in .SS "Compiling on Linux" On Linux, programs that use the Pthreads API should be compiled using .IR "cc \-pthread" .