STREAMS/UX for the HP 9000 Reference Manual

116
How to Compile and Link STREAMS/UX Drivers, Modules, and Applications
Compiling and Linking TLI/XTI Applications and Threads
Compiling and Linking TLI/XTI Applications and
Threads
As with the STREAMS/UX system calls, compiling and linking a TLI or
XTI application requires no special compile or linking options. Choose the
appropriate include files from the table below and compile. Link your
application with either the TLI library, libnsl_s.a or libnsl_s.sl, or the XTI
library, libxti.a or libxti.sl. Both libraries are in /usr/lib.
These libraries have been made thread-safe, that is, these libraries may be
used with both non-threaded and multi-threaded applications. Please see
OSF/DCE documentation for the POSIX threads library calls that may be
used.
The following caveats apply to this release of these libraries:
When a thread is executing within a TLI/XTI library call, the thread may not be
canceled. The library will turn both general and asynchronous cancellation off
during execution. This is necessary to avoid corruption of internal mutex
structures.
The global variable t_errno and the function t_strerror() will return values on a
per-thread basis. These values are stored in thread-specific pointers via the
pthread_setspecific() and pthread_getspecific() functions.
It is possible to deadlock a process should the application attempt to execute in
loopback using two threads within the same process’ address space. It is
Table 4 TLI/XTI Include Files
Include File Use
<xti.h> or <sys/xti.h> Needed by all XTI applications.
<tiuser.h> or <sys/tiuser.h> Needed by all TLI applications.
<poll.h> or <sys/poll.h> Needed by programs that use poll.
<stropts.h> or <sys/stropts.h> Needed by programs that use the STREAMS/UX
interface to perform operations such as pushing
modules onto a stream.