Multithreaded Programming Guide

Reentrant Functions for Unsafe Interfaces

For most functions with unsafe interfaces, an MT-Safe version of the routine exists. The name of the MT-Safe routine is the name of the Unsafe routine with “_r” appended. For example, the MT-Safe version of asctime() is asctime_r(). The Table 7–2_r” routines are supplied in the Solaris environment.

Table 7–2 Reentrant Functions

asctime_r(3c)

gethostbyname_r(3nsl)

getservbyname_r(3socket)

ctermid_r(3c)

gethostent_r(3nsl)

getservbyport_r(3socket)

ctime_r(3c)

getlogin_r(3c)

getservent_r(3socket)

fgetgrent_r(3c)

getnetbyaddr_r(3socket)

getspent_r(3c)

fgetpwent_r(3c)

getnetbyname_r(3socket)

getspnam_r(3c)

fgetspent_r(3c)

getnetent_r(3socket)

gmtime_r(3c)

gamma_r(3m)

getnetgrent_r(3c)

lgamma_r(3m)

getauclassent_r(3bsm)

getprotobyname_r(3socket)

localtime_r(3c)

getauclassnam_r(3bsm)

getprotobynumber_r(3socket)

nis_sperror_r(3nsl)

getauevent_r(3bsm)

getprotoent_r(3socket)

rand_r(3c)

getauevnam_r(3bsm)

getpwent_r(3c)

readdir_r(3c)

getauevnum_r(3bsm)

getpwnam_r(3c)

strtok_r(3c)

getgrent_r(3c)

getpwuid_r(3c)

tmpnam_r(3c)

getgrgid_r(3c)

getrpcbyname_r(3nsl)

ttyname_r(3c)

getgrnam_r(3c)

getrpcbynumber_r(3nsl)

 

gethostbyaddr_r(3nsl)

getrpcent_r(3nsl)