Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / putctl1.9f
blobf81c2660a70bdad9e320bdeb787652c171366c22
1 '\" te
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 PUTCTL1 9F "Jan 16, 2006"
9 .SH NAME
10 putctl1 \- send a control message with a one-byte parameter to a queue
11 .SH SYNOPSIS
12 .LP
13 .nf
14 #include <sys/stream.h>
18 \fBint\fR \fBputctl1\fR(\fBqueue_t *\fR\fIq\fR, \fBint\fR \fItype\fR, \fBint\fR \fIp\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Architecture independent level 1 (DDI/DKI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIq\fR\fR
30 .ad
31 .RS 8n
32 Queue to which the message is to be sent.
33 .RE
35 .sp
36 .ne 2
37 .na
38 \fB\fItype\fR\fR
39 .ad
40 .RS 8n
41 Type of message.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fIp\fR\fR
48 .ad
49 .RS 8n
50 One-byte parameter.
51 .RE
53 .SH DESCRIPTION
54 .sp
55 .LP
56 The \fBputctl1()\fR function, like \fBputctl\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 \fBputctl1()\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 \fBputctl1()\fR calls the \fBput\fR(9E) routine of the queue pointed to by
63 \fIq\fR with the newly allocated and initialized message.
64 .SH RETURN VALUES
65 .sp
66 .LP
67 On success, \fB1\fR is returned. \fB0\fR is returned if \fItype\fR is a data
68 type, or if a message block cannot be allocated.
69 .SH CONTEXT
70 .sp
71 .LP
72 The \fBputctl1()\fR function can be called from user, interrupt, or kernel
73 context.
74 .SH EXAMPLES
75 .sp
76 .LP
77 See the \fBputctl\fR(9F) function page for an example of \fBputctl1()\fR.
78 .SH SEE ALSO
79 .sp
80 .LP
81 \fBput\fR(9E), \fBallocb\fR(9F), \fBdatamsg\fR(9F), \fBputctl\fR(9F),
82 \fBputnextctl1\fR(9F)
83 .sp
84 .LP
85 \fIWriting Device Drivers\fR
86 .sp
87 .LP
88 \fISTREAMS Programming Guide\fR