Open System Services Programmer's Guide
Table 54 Process Resources (continued)
DescriptionTypeResource
The data maintained by the threads library on behalf of a thread;
contains the per-thread signal mask, which is used by the
pthread_kill() function
PrivateThread context
Includes process and module global resourcesGlobalAll external data
GlobalAll static internal variables
GlobalHeap
Includes file and record locksGlobalFile descriptors and file
state
GlobalSQL cursors
GlobalEnvironment variables
The per-process signal mask, used by the kill() functionGlobalSignal mask
Compiling and Linking Considerations
To use the Standard POSIX Threads library, you must:
• Include this header file:
/usr/include/spthread.h
The spthread.h file contains prototypes of the Standard POSIX Threads interfaces.
• Specify the _SPT_MODEL_ define. This define is required for systems running H06.21 or later
H-series RVUs or J06.10 or later J-series RVUs.
• For TNS/R programs, when linking with nld or ld, specify ZSPTSRL, the Standard POSIX
Threads shared run-time library.
• For TNS/E programs, when linking with eld, specify ZSPTDLL, the Standard POSIX Threads
DLL, before specifying any public libraries, such as ZSECDLL.
These libraries are located in the current sysnn subvolume.
Beginning with RVU G06.22, T1248 supports both the VERSION2 and VERSION3 C++ libraries.
Additionally, take special steps to ensure that exception handling will continue to function properly.
For compiling a TNS/R C++ program utilizing T1248 and the C++ exception handling mechanism,
link the object /usr/lib/sptcpp.o. This object ensures that exception handling will continue
to work, regardless of the C++ version. However, for programming exclusively in C, or in C++ on
a TNS/E system, linking /usr/lib/sptcpp.o is not necessary.
Error Reporting Changed From Previous Standard
Standard POSIX Threads functions return error indications as return values, instead of setting
errno. The error values returned are in many cases the values that were stored in errno in Draft
4. Standard POSIX Threads supports only the error values described in the Standard document.
If an error condition occurs, a pthread routine returns an integer value indicating the type of error.
For example, a call to the Draft 4 implementation of pthread_cond_ destroy() that returned
a -1 and set errno to EBUSY now returns EBUSY as the routine return value.
Reporting errors by returning error values is a global change from the previous standard (Draft 4),
in which errors are reported in errno. If you are porting a threaded application that adheres to
Draft 4, you must rewrite the error handling routines. The “Threaded Application Examples”
(page 335) demonstrates error handling with Standard POSIX Threads. See the Open System Services
Porting Guide for a list of the supported return values as well as other porting issues.
314 Using the Standard POSIX Threads Library