9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / canput.9f
blobdfeab6c291c4eabbca2fa0a70e4d36bc631e72d3
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH CANPUT 9F "Apr 11, 1991"
8 .SH NAME
9 canput \- test for room in a message queue
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/stream.h>
17 \fBint\fR \fBcanput\fR(\fBqueue_t *\fR\fIq\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 Architecture independent level 1 (DDI/DKI).
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fIq\fR \fR
29 .ad
30 .RS 6n
31 Pointer to the message queue.
32 .RE
34 .SH DESCRIPTION
35 .sp
36 .LP
37 \fBcanput()\fR searches through the stream (starting at \fIq\fR) until it finds
38 a queue containing a service routine where the message can be enqueued, or
39 until it reaches the end of the stream.  If found, the queue containing the
40 service routine is tested to see if there is room for a message in the queue.
41 .sp
42 .LP
43 \fBcanputnext(\fR\fIq\fR\fB)\fR and \fBbcanputnext(\fR\fIq\fR\fB,\fR\fI
44 pri\fR\fB)\fR should always be used in preference to
45 \fBcanput(\fR\fIq\fR\fB\(->q_next)\fR and
46 \fBbcanput(\fR\fIq\fR\fB\(->q_next,\fR\fI pri\fR\fB)\fR respectively.
47 .SH RETURN VALUES
48 .sp
49 .ne 2
50 .na
51 \fB\fB1\fR \fR
52 .ad
53 .RS 6n
54 If the message queue is not full.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fB0\fR \fR
61 .ad
62 .RS 6n
63 If the queue is full.
64 .RE
66 .SH CONTEXT
67 .sp
68 .LP
69 \fBcanput()\fR can be called from user or interrupt context.
70 .SH SEE ALSO
71 .sp
72 .LP
73 \fBbcanput\fR(9F), \fBbcanputnext\fR(9F), \fBcanputnext\fR(9F),
74 \fBputbq\fR(9F), \fBputnext\fR(9F)
75 .sp
76 .LP
77 \fIWriting Device Drivers\fR
78 .sp
79 .LP
80  \fISTREAMS Programming Guide\fR
81 .SH WARNINGS
82 .sp
83 .LP
84 Drivers are responsible for both testing a queue with \fBcanput()\fR and
85 refraining from placing a message on the queue if \fBcanput()\fR fails.