STREAMS/UX for the HP 9000 Reference Manual
44
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Modifications to STREAMS/UX Utilities
instead of acquiring a spinlock. Whether the caller will block or spin if the
lock cannot be obtained is implementation defined. The HP-UX
implementation spins.
LOCK_ALLOC
The STREAMS/UX LOCK_ALLOC calls the native HP-UX alloc_spinlock
primitive. There are some small differences between the STREAMS/UX
LOCK_ALLOC and the SVR4 MP utility. LOCK_ALLOC has a flag
parameter which indicates if the caller is willing to block while waiting for
memory to be allocated. HP-UX only allows this flag to be set to
KM_SLEEP, and returns zero if it is set to KM_NOSLEEP. The
STREAMS/UX LOCK_ALLOC accepts the following hierarchy parameter
values which are reserved for STREAMS/UX modules and drivers in
/usr/include/sys/semglobal.h and /usr/conf/h/semglobal.h:
STREAMS_USR1_LOCK_ORDER, STREAMS_USR2_LOCK_ORDER,
and STREAMS_USR3_LOCK_ORDER. The compiler options to turn on
deadlock checking for HP-UX are different than those documented in the
SVR4.2 Driver manual. The entire HP-UX kernel and the module or driver
must be compiled with SEMAPHORE_DEBUG to enable deadlock
checking. According to the SVR4.2 Driver manual, the min_pl parameter
can be ignored by implementations which do not need to raise the priority
level. The HP-UX STREAMS LOCK_ALLOC ignores it.
putctl2
STREAMS/UX also provides the additional utility called putctl2. This
utility can be used to send a control message with a two-byte parameter to a
queue. For example, putctl2 can send the new style of an M_ERROR
message, which is two bytes long, to a queue.
int putctl2(q, type, p1, p2);
queue_t * q;
int type;
int p1;
int p2;
The q parameter is the queue to which the message is sent. The type
parameter is the message type. The p1 and p2 parameters are the two bytes
of data in the message. The putctl2 utility ensures that the type is not a data
type. The utility also allocates a message block, fills in the data, and calls