Multithreaded Programming Guide

Choosing Solaris or POSIX Semantics

Certain functions, including the ones listed below, have different semantics in the POSIX 1003.1c standard than in the Solaris 2.4 release, which was based on an earlier POSIX draft. Function definitions are chosen at compile time. See the man Pages(3): Library Routines for a description of the differences in expected parameters and return values.

Table 7-1 Functions with POSIX/Solaris Semantic Differences

sigwait(2)

 

ctime_r(3C)

asctime_r(3C)

ftrylockfile(3S) - new

getlogin_r(3C)

getgrnam_r(3C)

getgrgid_r(3C)

getpwnam_r(3C)

getpwuid_r(3C)

readdir_r(3C)

ttyname_r(3C)

The Solaris fork(2) function duplicates all threads (fork-all behavior), while the POSIX fork(2) function duplicates only the calling thread (fork-one behavior), as does the Solaris fork1() function.

The handling of an alarm(2) is also different: a Solaris alarm goes to the thread's LWP, while a POSIX alarm goes to the whole process (see "Per-Thread Alarms";).