Open System Services Programmer's Guide
Build Scripts
Build scripts used to compile application modules must define macro _PUT_MODEL_. This macro
determines which definitions are obtained from various header files such as sys/types.h and
stdio.h. The build scripts must not define macro _SPT_MODEL_. The build scripts must also
specify linking the PUT Model library (for example, the c89 –lput option) and must not specify
linking the SPT library (for example, dot use the –lspt option).
Although dynamic linking is possible for the SPT library (a call to dlopen() can cause the SPT
library to be linked during the execution of the application). Static linking is required for the PUT
Model library. The run-time environment terminates execution of an application if a call to the
dlopen() function requires the dynamic linking of the PUT Model library.
Header Files
You must change the header file in #include statements from spthread.h to pthread.h.
Standard Header Files
Because the pthread.h header file includes different standard header files than the spthread.h
header file, you might need to change your application to explicitly include header files that were
formerly provided by the spthread.h header file.
Table 74 Standard header files included in spthread.h and pthread.h header files
Included Standard Header FilesHeader file
spthread.h unistd.herrno.h
wchar.hfcntl.h
sys/socket.hsched.h
sys/stat.hstdio.h
sys/time.hstdlib.h
signal.h
pthread.h sys/types.hsched.h
setjmp.h
It is important to investigate any warning diagnostics generated when a source text is compiled
after changing an inclusion of spthread.h into an inclusion of pthread.h. For example, a
warning such as function "fcntl" declared implicitly reports that no explicit definition
of fcntl() was declared, therefore the compiler assumed defaults for all function attributes.
Consequently, calls to fcntl() are not mapped to the non-blocking variant of fcntl(). For a
PUT Model application this situation causes an unneeded and unwanted suspension of the entire
process. The remedy in such cases is to include whichever standard header file defines the function
and to ensure that you have also defined the _PUT_MODEL_ macro.
Nonstandard Header Files
The SPT library provides nonstandard headers in these header files:
spt_extensions.h
spt_types.h
spt_ucontext.h
The PUT Model library provides nonstandard headers in the header file:
put/put_extensions.h, which includes the header file put/put_types.h
The put/put_extensions.h header file contains definitions supporting the enhanced function
behavior that SPT library applications obtain from the spt_extensions.h header file.
424 Using the POSIX User Thread (PUT) Model Library