Open System Services Programmer's Guide

function name, such as read() and you must include the appropriate standard header file. For
more information about these functions, see Thread-Aware and Nonblocking OSS Functions
(page 396).
Nonstandard spt_* Functions Have put_* Equivalents
The SPT library provides some non-standard spt_*() and SPT_functions, such as
spt_select_single_np() and SPT_INITRECEIVE(). The PUT Model library provide analogs
to these functions that you can call directly. If an application module contains calls to such functions,
they must be replaced with calls to the equivalent put_*() or PUT_*() function (for example,
put_select_single_np() and PUT_INITRECEIVE()). Such changes are straightforward
because only the function name is different; there is no change to parameter types or the function
semantics. Reference pages for all the put_*() and PUT_*() functions are included in either
the Open System Services System Calls Reference Manual or the Open System Services Library
Calls Reference Manual.
The put/put_extensions.h header file provides the prototypes for nonstandard functions. If
the macro _TANDEM_SOURCE is defined, directly or indirectly, then when the compiler reads
pthread.h it reads put/put_extensions.h as well. Otherwise you must explicitly include
the put/put_extensions.h header file in your application.
Standard pthread_* functions replace some nonstandard pthread_* functions
The PUT Model library provides a few standard pthread_*() functions that replace the nonstandard
versions provided by the SPT library:
Table 76 Nonstandard pthread_ functions replaced by standard versions
Standard PUT Model library functionNonstandard SPT library function
pthread_mutexattr_gettype()pthread_mutexattr_getkind_np()
pthread_mutexattr_settype()pthread_mutexattr_setkind_np()
pthread_attr_getguardsize()pthread_attr_getguardsize_np()
pthread_attr_setguardsize()pthread_attr_setguardsize_np()
Header File Locations for Reentrant Functions
The SPT library provides reentrant functions that are thread-safe alternatives to standard functions
whose semantics make their use by a threaded program unsafe. The SPT header file
spt_extensions.h provides the prototypes for all of these functions.
The PUT Model library does not provide any of the reentrant functions. Instead, each such function
is provided by the same public library and header file that provides the non-reentrant version of
the function. For example, the time.h header file defines both the asctime() and asctime_r()
functions. Consequently, each PUT Library module that refers to a reentrant function must include
the appropriate header.
Implementations of getgrent_r() and getpwent_r() Functions
The implementations of functions getgrent_r() and getpwent_r() in the OSS subject API
library (ZSECDLL) conform to the standard and each of these functions have four parameters. The
corresponding SPT functions have only the first three parameters. Consequently the logic of an
application module that calls the getgrent_r() or getpwent_r() function requires revision.
For more information about these functions, see the reference page for the function either online
or in the Open System Services Library Calls Reference Manual.
426 Using the POSIX User Thread (PUT) Model Library