DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer 5

putctl1(D3str)


putctl1 -- send a control message with a one-byte parameter to a queue

Synopsis

   #include <sys/stream.h>
   #include <sys/ddi.h>
   

int putctl1(queue_t *q, int type, int param);

Description

putctl1, like putctl(D3str), tests the type argument to make sure a data type has not been specified, and attempts to allocate a message block. The param parameter can be used, for example, to specify the signal number when an M_PCSIG(D7str) message is being sent. putctl1 fails if type is M_DATA(D7str), M_PROTO(D7str), or M_PCPROTO(D7str), or if a message block cannot be allocated. If successful, putctl1 calls the put(D2str) routine of the queue pointed to by q, passing it the allocated message.

Arguments


q
Pointer to the queue to which the message is to be sent.

type
Message type (must be a control type).

param
One-byte parameter.

Return values

On success, 1 is returned. Otherwise, if type is a data type, or if a message block cannot be allocated, 0 is returned.

Usage

In multithreaded DDI drivers, the q argument to putctl1 and putnextctl1(D3str) may not reference q_next. For example, an argument of q->q_next is erroneous in a multithreaded driver and is disallowed by the DDI. putnextctl1(q, type) is provided as a multiprocessor-safe equivalent to the common call putctl1(q->q_next, type), which is no longer allowed.

Context

Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may not be held across calls to this function.

The caller cannot have the stream frozen (see freezestr(D3str)) when calling this function.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

References

put(D2str), put(D3str), putctl(D3str), putnextctl(D3str), putnextctl1(D3str)

Examples

See putctl(D3str) for an example of putctl1.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005