2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2006, Sun Microsystems, Inc.,
4 .\" All Rights Reserved
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH PUTNEXTCTL1 9F "Jan 16, 2006"
10 putnextctl1 \- send a control message with a one-byte parameter to a queue
14 #include <sys/stream.h>
18 \fBint\fR \fBputnextctl1\fR(\fBqueue_t *\fR\fIq\fR, \fBint\fR \fItype\fR, \fBint\fR \fIp\fR);
24 Architecture independent level 1 (DDI/DKI).
32 Queue to which the message is to be sent.
56 The \fBputnextctl1()\fR function, like \fBputctl1\fR(9F), tests the \fItype\fR
57 argument to make sure a data type has not been specified, and attempts to
58 allocate a message block. The \fIp\fR parameter can be used, for example, to
59 specify how long the delay will be when an \fBM_DELAY\fR message is being sent.
60 \fBputnextctl1()\fR fails if \fItype\fR is \fBM_DATA\fR, \fBM_PROTO\fR, or
61 \fBM_PCPROTO\fR, or if a message block cannot be allocated. If successful,
62 \fBputnextctl1()\fR calls the \fBput\fR(9E) routine of the queue pointed to by
63 \fIq\fR with the newly allocated and initialized message.
66 A call to \fBputnextctl1(\fR\fIq\fR,\fItype, p\fR\fB)\fR is an atomic
67 equivalent of \fBputctl1(\fR\fIq\fR\fB->q_next,\fR \fItype, p\fR\fB).\fR The
68 STREAMS framework provides whatever mutual exclusion is necessary to insure
69 that dereferencing \fIq\fR through its \fBq_next\fR field and then invoking
70 \fBputctl1\fR(9F) proceeds without interference from other threads.
73 The \fBputnextctl1()\fR function should always be used in preference to
78 On success, \fB1\fR is returned. \fB0\fR is returned if \fItype\fR is a data
79 type, or if a message block cannot be allocated.
83 The \fBputnextctl1()\fR function can be called from user, interrupt, or kernel
88 See the \fBputnextctl\fR(9F) function page for an example of
93 \fBput\fR(9E), \fBallocb\fR(9F), \fBdatamsg\fR(9F), \fBputctl1\fR(9F),
97 \fIWriting Device Drivers\fR
100 \fISTREAMS Programming Guide\fR