1putnextctl1(9F) Kernel Functions for Drivers putnextctl1(9F)
2
3
4
6 putnextctl1 - send a control message with a one-byte parameter to a
7 queue
8
10 #include <sys/stream.h>
11
12
13
14 int putnextctl1(queue_t *q, int type, int p);
15
16
18 Architecture independent level 1 (DDI/DKI).
19
21 q Queue to which the message is to be sent.
22
23
24 type Type of message.
25
26
27 p One-byte parameter.
28
29
31 The putnextctl1() function, like putctl1(9F), tests the type argument
32 to make sure a data type has not been specified, and attempts to allo‐
33 cate a message block. The p parameter can be used, for example, to
34 specify how long the delay will be when an M_DELAY message is being
35 sent. putnextctl1() fails if type is M_DATA, M_PROTO, or M_PCPROTO, or
36 if a message block cannot be allocated. If successful, putnextctl1()
37 calls the put(9E) routine of the queue pointed to by q with the newly
38 allocated and initialized message.
39
40
41 A call to putnextctl1(q,type, p) is an atomic equivalent of
42 putctl1(q->q_next, type, p). The STREAMS framework provides whatever
43 mutual exclusion is necessary to insure that dereferencing q through
44 its q_next field and then invoking putctl1(9F) proceeds without inter‐
45 ference from other threads.
46
47
48 The putnextctl1() function should always be used in preference to
49 putctl1(9F)
50
52 On success, 1 is returned. 0 is returned if type is a data type, or if
53 a message block cannot be allocated.
54
56 The putnextctl1() function can be called from user, interrupt, or ker‐
57 nel context.
58
60 See the putnextctl(9F) function page for an example of putnextctl1().
61
63 put(9E), allocb(9F), datamsg(9F), putctl1(9F), putnextctl(9F)
64
65
66 Writing Device Drivers
67
68
69 STREAMS Programming Guide
70
71
72
73SunOS 5.11 16 Jan 2006 putnextctl1(9F)