1canput(9F)               Kernel Functions for Drivers               canput(9F)
2
3
4

NAME

6       canput - test for room in a message queue
7

SYNOPSIS

9       #include <sys/stream.h>
10
11
12
13       int canput(queue_t *q);
14
15

INTERFACE LEVEL

17       Architecture independent level 1 (DDI/DKI).
18

PARAMETERS

20       q     Pointer to the message queue.
21
22

DESCRIPTION

24       canput()  searches  through the stream (starting at q) until it finds a
25       queue containing a service routine where the message can  be  enqueued,
26       or  until  it  reaches the end of the stream.  If found, the queue con‐
27       taining the service routine is tested to see if there  is  room  for  a
28       message in the queue.
29
30
31       canputnext(q)  and bcanputnext(q, pri) should always be used in prefer‐
32       ence to canput(q→q_next) and bcanput(q→q_next, pri) respectively.
33

RETURN VALUES

35       1     If the message queue is not full.
36
37
38       0     If the queue is full.
39
40

CONTEXT

42       canput() can be called from user or interrupt context.
43

SEE ALSO

45       bcanput(9F), bcanputnext(9F), canputnext(9F), putbq(9F), putnext(9F)
46
47
48       Writing Device Drivers
49
50
51        STREAMS Programming Guide
52

WARNINGS

54       Drivers are responsible for both testing  a  queue  with  canput()  and
55       refraining from placing a message on the queue if canput() fails.
56
57
58
59SunOS 5.11                        11 Apr 1991                       canput(9F)
Impressum