| @@ -1,516 +1,518 @@ | | | @@ -1,516 +1,518 @@ |
1 | /* | | 1 | /* |
2 | * CDDL HEADER START | | 2 | * CDDL HEADER START |
3 | * | | 3 | * |
4 | * The contents of this file are subject to the terms of the | | 4 | * The contents of this file are subject to the terms of the |
5 | * Common Development and Distribution License (the "License"). | | 5 | * Common Development and Distribution License (the "License"). |
6 | * You may not use this file except in compliance with the License. | | 6 | * You may not use this file except in compliance with the License. |
7 | * | | 7 | * |
8 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | | 8 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
9 | * or http://www.opensolaris.org/os/licensing. | | 9 | * or http://www.opensolaris.org/os/licensing. |
10 | * See the License for the specific language governing permissions | | 10 | * See the License for the specific language governing permissions |
11 | * and limitations under the License. | | 11 | * and limitations under the License. |
12 | * | | 12 | * |
13 | * When distributing Covered Code, include this CDDL HEADER in each | | 13 | * When distributing Covered Code, include this CDDL HEADER in each |
14 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | | 14 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
15 | * If applicable, add the following below this CDDL HEADER, with the | | 15 | * If applicable, add the following below this CDDL HEADER, with the |
16 | * fields enclosed by brackets "[]" replaced with your own identifying | | 16 | * fields enclosed by brackets "[]" replaced with your own identifying |
17 | * information: Portions Copyright [yyyy] [name of copyright owner] | | 17 | * information: Portions Copyright [yyyy] [name of copyright owner] |
18 | * | | 18 | * |
19 | * CDDL HEADER END | | 19 | * CDDL HEADER END |
20 | */ | | 20 | */ |
21 | /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ | | 21 | /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ |
22 | /* All Rights Reserved */ | | 22 | /* All Rights Reserved */ |
23 | | | 23 | |
24 | | | 24 | |
25 | /* | | 25 | /* |
26 | * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | | 26 | * Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
27 | * Use is subject to license terms. | | 27 | * Use is subject to license terms. |
28 | */ | | 28 | */ |
29 | | | 29 | |
30 | #ifndef _SYS_STROPTS_H | | 30 | #ifndef _SYS_STROPTS_H |
31 | #define _SYS_STROPTS_H | | 31 | #define _SYS_STROPTS_H |
32 | | | 32 | |
33 | #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 11.20 */ | | 33 | #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 11.20 */ |
34 | | | 34 | |
35 | #include <sys/feature_tests.h> | | 35 | #include <sys/feature_tests.h> |
36 | #include <sys/types.h> | | 36 | #include <sys/types.h> |
37 | /* | | 37 | /* |
38 | * For FMNAMESZ define. | | 38 | * For FMNAMESZ define. |
39 | */ | | 39 | */ |
| | | 40 | #ifdef _KERNEL |
40 | #include <sys/conf.h> | | 41 | #include <sys/conf.h> |
| | | 42 | #endif |
41 | | | 43 | |
42 | #ifdef __cplusplus | | 44 | #ifdef __cplusplus |
43 | extern "C" { | | 45 | extern "C" { |
44 | #endif | | 46 | #endif |
45 | | | 47 | |
46 | /* | | 48 | /* |
47 | * Write options | | 49 | * Write options |
48 | */ | | 50 | */ |
49 | #define SNDZERO 0x001 /* send a zero length message */ | | 51 | #define SNDZERO 0x001 /* send a zero length message */ |
50 | #define SNDPIPE 0x002 /* send SIGPIPE on write and */ | | 52 | #define SNDPIPE 0x002 /* send SIGPIPE on write and */ |
51 | /* putmsg if sd_werror is set */ | | 53 | /* putmsg if sd_werror is set */ |
52 | | | 54 | |
53 | /* | | 55 | /* |
54 | * Read options | | 56 | * Read options |
55 | */ | | 57 | */ |
56 | #define RNORM 0x000 /* read msg norm */ | | 58 | #define RNORM 0x000 /* read msg norm */ |
57 | #define RMSGD 0x001 /* read msg discard */ | | 59 | #define RMSGD 0x001 /* read msg discard */ |
58 | #define RMSGN 0x002 /* read msg no discard */ | | 60 | #define RMSGN 0x002 /* read msg no discard */ |
59 | | | 61 | |
60 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 62 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
61 | #define RMODEMASK 0x003 /* all above bits */ | | 63 | #define RMODEMASK 0x003 /* all above bits */ |
62 | #endif | | 64 | #endif |
63 | | | 65 | |
64 | /* | | 66 | /* |
65 | * These next three read options are added for the sake of | | 67 | * These next three read options are added for the sake of |
66 | * user-level transparency. RPROTDAT will cause the stream head | | 68 | * user-level transparency. RPROTDAT will cause the stream head |
67 | * to treat the contents of M_PROTO and M_PCPROTO message blocks | | 69 | * to treat the contents of M_PROTO and M_PCPROTO message blocks |
68 | * as data. RPROTDIS will prevent the stream head from failing | | 70 | * as data. RPROTDIS will prevent the stream head from failing |
69 | * a read with EBADMSG if an M_PROTO or M_PCPROTO message is on | | 71 | * a read with EBADMSG if an M_PROTO or M_PCPROTO message is on |
70 | * the front of the stream head read queue. Rather, the protocol | | 72 | * the front of the stream head read queue. Rather, the protocol |
71 | * blocks will be silently discarded and the data associated with | | 73 | * blocks will be silently discarded and the data associated with |
72 | * the message (in linked M_DATA blocks), if any, will be delivered | | 74 | * the message (in linked M_DATA blocks), if any, will be delivered |
73 | * to the user. RPROTNORM sets the default behavior, where read | | 75 | * to the user. RPROTNORM sets the default behavior, where read |
74 | * will fail with EBADMSG if an M_PROTO or M_PCPROTO are at the | | 76 | * will fail with EBADMSG if an M_PROTO or M_PCPROTO are at the |
75 | * stream head. | | 77 | * stream head. |
76 | */ | | 78 | */ |
77 | #define RPROTDAT 0x004 /* read protocol messages as data */ | | 79 | #define RPROTDAT 0x004 /* read protocol messages as data */ |
78 | #define RPROTDIS 0x008 /* discard protocol messages, but */ | | 80 | #define RPROTDIS 0x008 /* discard protocol messages, but */ |
79 | /* read data portion */ | | 81 | /* read data portion */ |
80 | #define RPROTNORM 0x010 | | 82 | #define RPROTNORM 0x010 |
81 | | | 83 | |
82 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 84 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
83 | #define RPROTMASK 0x01c /* all RPROT bits */ | | 85 | #define RPROTMASK 0x01c /* all RPROT bits */ |
84 | | | 86 | |
85 | /* | | 87 | /* |
86 | * The next read option is used so that a TPI aware module can tell the | | 88 | * The next read option is used so that a TPI aware module can tell the |
87 | * stream head to not flush M_PCPROTO messages when processing a read side | | 89 | * stream head to not flush M_PCPROTO messages when processing a read side |
88 | * flush. This will avoid problems where a flush removes a T_OK_ACK. | | 90 | * flush. This will avoid problems where a flush removes a T_OK_ACK. |
89 | */ | | 91 | */ |
90 | #define RFLUSHMASK 0x020 /* all RFLUSH bits */ | | 92 | #define RFLUSHMASK 0x020 /* all RFLUSH bits */ |
91 | | | 93 | |
92 | #define RFLUSHPCPROT 0x020 /* do not flush PCPROTOs */ | | 94 | #define RFLUSHPCPROT 0x020 /* do not flush PCPROTOs */ |
93 | | | 95 | |
94 | #endif | | 96 | #endif |
95 | | | 97 | |
96 | /* | | 98 | /* |
97 | * Error options | | 99 | * Error options |
98 | */ | | 100 | */ |
99 | | | 101 | |
100 | /* | | 102 | /* |
101 | * Error options to adjust the stream head error behavior with respect | | 103 | * Error options to adjust the stream head error behavior with respect |
102 | * to M_ERROR message for read and write side errors respectively. | | 104 | * to M_ERROR message for read and write side errors respectively. |
103 | * The normal case is that the read/write side error is | | 105 | * The normal case is that the read/write side error is |
104 | * persistent and these options allow the application or streams module/driver | | 106 | * persistent and these options allow the application or streams module/driver |
105 | * to specify that errors are nonpersistent. In this case the error is cleared | | 107 | * to specify that errors are nonpersistent. In this case the error is cleared |
106 | * after having been returned to read(), getmsg(), ioctl(), write(), putmsg(), | | 108 | * after having been returned to read(), getmsg(), ioctl(), write(), putmsg(), |
107 | * etc. | | 109 | * etc. |
108 | */ | | 110 | */ |
109 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 111 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
110 | #define RERRNORM 0x001 /* Normal, persistent read errors */ | | 112 | #define RERRNORM 0x001 /* Normal, persistent read errors */ |
111 | #define RERRNONPERSIST 0x002 /* Nonpersistent read errors */ | | 113 | #define RERRNONPERSIST 0x002 /* Nonpersistent read errors */ |
112 | | | 114 | |
113 | #define RERRMASK (RERRNORM|RERRNONPERSIST) | | 115 | #define RERRMASK (RERRNORM|RERRNONPERSIST) |
114 | | | 116 | |
115 | #define WERRNORM 0x004 /* Normal, persistent write errors */ | | 117 | #define WERRNORM 0x004 /* Normal, persistent write errors */ |
116 | #define WERRNONPERSIST 0x008 /* Nonpersistent write errors */ | | 118 | #define WERRNONPERSIST 0x008 /* Nonpersistent write errors */ |
117 | | | 119 | |
118 | #define WERRMASK (WERRNORM|WERRNONPERSIST) | | 120 | #define WERRMASK (WERRNORM|WERRNONPERSIST) |
119 | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ | | 121 | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ |
120 | | | 122 | |
121 | /* | | 123 | /* |
122 | * Flush options | | 124 | * Flush options |
123 | */ | | 125 | */ |
124 | | | 126 | |
125 | #define FLUSHR 0x01 /* flush read queue */ | | 127 | #define FLUSHR 0x01 /* flush read queue */ |
126 | #define FLUSHW 0x02 /* flush write queue */ | | 128 | #define FLUSHW 0x02 /* flush write queue */ |
127 | #define FLUSHRW 0x03 /* flush both queues */ | | 129 | #define FLUSHRW 0x03 /* flush both queues */ |
128 | #define FLUSHBAND 0x04 /* flush only band specified */ | | 130 | #define FLUSHBAND 0x04 /* flush only band specified */ |
129 | /* in next byte */ | | 131 | /* in next byte */ |
130 | /* | | 132 | /* |
131 | * Copy options for M_SETOPS/SO_COPYOPT | | 133 | * Copy options for M_SETOPS/SO_COPYOPT |
132 | */ | | 134 | */ |
133 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 135 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
134 | #define ZCVMSAFE 0x01 /* safe to borrow file (segmapped) */ | | 136 | #define ZCVMSAFE 0x01 /* safe to borrow file (segmapped) */ |
135 | /* pages instead of bcopy */ | | 137 | /* pages instead of bcopy */ |
136 | #define ZCVMUNSAFE 0x02 /* unsafe to borrow file pages */ | | 138 | #define ZCVMUNSAFE 0x02 /* unsafe to borrow file pages */ |
137 | #define COPYCACHED 0x04 /* copy should NOT bypass cache */ | | 139 | #define COPYCACHED 0x04 /* copy should NOT bypass cache */ |
138 | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ | | 140 | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ |
139 | | | 141 | |
140 | /* | | 142 | /* |
141 | * Events for which the SIGPOLL signal is to be sent. | | 143 | * Events for which the SIGPOLL signal is to be sent. |
142 | */ | | 144 | */ |
143 | #define S_INPUT 0x0001 /* any msg but hipri on read Q */ | | 145 | #define S_INPUT 0x0001 /* any msg but hipri on read Q */ |
144 | #define S_HIPRI 0x0002 /* high priority msg on read Q */ | | 146 | #define S_HIPRI 0x0002 /* high priority msg on read Q */ |
145 | #define S_OUTPUT 0x0004 /* write Q no longer full */ | | 147 | #define S_OUTPUT 0x0004 /* write Q no longer full */ |
146 | #define S_MSG 0x0008 /* signal msg at front of read Q */ | | 148 | #define S_MSG 0x0008 /* signal msg at front of read Q */ |
147 | #define S_ERROR 0x0010 /* error msg arrived at stream head */ | | 149 | #define S_ERROR 0x0010 /* error msg arrived at stream head */ |
148 | #define S_HANGUP 0x0020 /* hangup msg arrived at stream head */ | | 150 | #define S_HANGUP 0x0020 /* hangup msg arrived at stream head */ |
149 | #define S_RDNORM 0x0040 /* normal msg on read Q */ | | 151 | #define S_RDNORM 0x0040 /* normal msg on read Q */ |
150 | #define S_WRNORM S_OUTPUT | | 152 | #define S_WRNORM S_OUTPUT |
151 | #define S_RDBAND 0x0080 /* out of band msg on read Q */ | | 153 | #define S_RDBAND 0x0080 /* out of band msg on read Q */ |
152 | #define S_WRBAND 0x0100 /* can write out of band */ | | 154 | #define S_WRBAND 0x0100 /* can write out of band */ |
153 | #define S_BANDURG 0x0200 /* modifier to S_RDBAND, to generate */ | | 155 | #define S_BANDURG 0x0200 /* modifier to S_RDBAND, to generate */ |
154 | /* SIGURG instead of SIGPOLL */ | | 156 | /* SIGURG instead of SIGPOLL */ |
155 | | | 157 | |
156 | /* | | 158 | /* |
157 | * Flags for getmsg() and putmsg() syscall arguments. | | 159 | * Flags for getmsg() and putmsg() syscall arguments. |
158 | * "RS" stands for recv/send. The system calls were originally called | | 160 | * "RS" stands for recv/send. The system calls were originally called |
159 | * recv() and send(), but were renamed to avoid confusion with the BSD | | 161 | * recv() and send(), but were renamed to avoid confusion with the BSD |
160 | * calls of the same name. A value of zero will cause getmsg() to return | | 162 | * calls of the same name. A value of zero will cause getmsg() to return |
161 | * the first message on the stream head read queue and putmsg() to send | | 163 | * the first message on the stream head read queue and putmsg() to send |
162 | * a normal priority message. | | 164 | * a normal priority message. |
163 | * | | 165 | * |
164 | * Flags for strmakemsg() arguments (should define strmakemsg() flags). | | 166 | * Flags for strmakemsg() arguments (should define strmakemsg() flags). |
165 | * Used to determine the message type of the control part of a message, | | 167 | * Used to determine the message type of the control part of a message, |
166 | * if RS_HIPRI, M_PCPROTO, else M_PROTO. | | 168 | * if RS_HIPRI, M_PCPROTO, else M_PROTO. |
167 | */ | | 169 | */ |
168 | | | 170 | |
169 | #define RS_HIPRI 0x01 /* send/recv high priority message */ | | 171 | #define RS_HIPRI 0x01 /* send/recv high priority message */ |
170 | #define STRUIO_POSTPONE 0x08 /* postpone copyin() for struio() */ | | 172 | #define STRUIO_POSTPONE 0x08 /* postpone copyin() for struio() */ |
171 | | | 173 | |
172 | /* | | 174 | /* |
173 | * Flags for getpmsg() and putpmsg() syscall arguments. | | 175 | * Flags for getpmsg() and putpmsg() syscall arguments. |
174 | */ | | 176 | */ |
175 | | | 177 | |
176 | /* | | 178 | /* |
177 | * These are settable by the user and will be set on return | | 179 | * These are settable by the user and will be set on return |
178 | * to indicate the priority of message received. | | 180 | * to indicate the priority of message received. |
179 | */ | | 181 | */ |
180 | #define MSG_HIPRI 0x01 /* send/recv high priority message */ | | 182 | #define MSG_HIPRI 0x01 /* send/recv high priority message */ |
181 | #define MSG_ANY 0x02 /* recv any messages */ | | 183 | #define MSG_ANY 0x02 /* recv any messages */ |
182 | #define MSG_BAND 0x04 /* recv messages from specified band */ | | 184 | #define MSG_BAND 0x04 /* recv messages from specified band */ |
183 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 185 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
184 | /* | | 186 | /* |
185 | * This is a private flag passed by libc to kernel to | | 187 | * This is a private flag passed by libc to kernel to |
186 | * identify that it is a XPG4_2 application. No | | 188 | * identify that it is a XPG4_2 application. No |
187 | * applications need to know about this flag. | | 189 | * applications need to know about this flag. |
188 | */ | | 190 | */ |
189 | #define MSG_XPG4 0x08 | | 191 | #define MSG_XPG4 0x08 |
190 | #endif | | 192 | #endif |
191 | | | 193 | |
192 | #ifdef _KERNEL | | 194 | #ifdef _KERNEL |
193 | | | 195 | |
194 | /* | | 196 | /* |
195 | * Additional private flags for kstrgetmsg and kstrputmsg. | | 197 | * Additional private flags for kstrgetmsg and kstrputmsg. |
196 | * These must be bit-wise distinct from the above MSG flags. | | 198 | * These must be bit-wise distinct from the above MSG flags. |
197 | */ | | 199 | */ |
198 | #define MSG_IPEEK 0x10 /* Peek - don't remove the message */ | | 200 | #define MSG_IPEEK 0x10 /* Peek - don't remove the message */ |
199 | #define MSG_DISCARDTAIL 0x20 /* Discard tail if it doesn't fit */ | | 201 | #define MSG_DISCARDTAIL 0x20 /* Discard tail if it doesn't fit */ |
200 | #define MSG_HOLDSIG 0x40 /* Ignore signals. */ | | 202 | #define MSG_HOLDSIG 0x40 /* Ignore signals. */ |
201 | #define MSG_IGNERROR 0x80 /* Ignore stream head errors */ | | 203 | #define MSG_IGNERROR 0x80 /* Ignore stream head errors */ |
202 | #define MSG_DELAYERROR 0x100 /* Delay error check until we sleep */ | | 204 | #define MSG_DELAYERROR 0x100 /* Delay error check until we sleep */ |
203 | #define MSG_IGNFLOW 0x200 /* Ignore flow control */ | | 205 | #define MSG_IGNFLOW 0x200 /* Ignore flow control */ |
204 | #define MSG_NOMARK 0x400 /* Do not read if message is marked */ | | 206 | #define MSG_NOMARK 0x400 /* Do not read if message is marked */ |
205 | | | 207 | |
206 | #endif /* _KERNEL */ | | 208 | #endif /* _KERNEL */ |
207 | | | 209 | |
208 | /* | | 210 | /* |
209 | * Flags returned as value of getmsg() and getpmsg() syscall. | | 211 | * Flags returned as value of getmsg() and getpmsg() syscall. |
210 | */ | | 212 | */ |
211 | #define MORECTL 1 /* more ctl info is left in message */ | | 213 | #define MORECTL 1 /* more ctl info is left in message */ |
212 | #define MOREDATA 2 /* more data is left in message */ | | 214 | #define MOREDATA 2 /* more data is left in message */ |
213 | | | 215 | |
214 | /* | | 216 | /* |
215 | * Define to indicate that all multiplexors beneath a stream should | | 217 | * Define to indicate that all multiplexors beneath a stream should |
216 | * be unlinked. | | 218 | * be unlinked. |
217 | */ | | 219 | */ |
218 | #define MUXID_ALL (-1) | | 220 | #define MUXID_ALL (-1) |
219 | | | 221 | |
220 | /* | | 222 | /* |
221 | * Flag definitions for the I_ATMARK ioctl. | | 223 | * Flag definitions for the I_ATMARK ioctl. |
222 | */ | | 224 | */ |
223 | #define ANYMARK 0x01 | | 225 | #define ANYMARK 0x01 |
224 | #define LASTMARK 0x02 | | 226 | #define LASTMARK 0x02 |
225 | | | 227 | |
226 | /* | | 228 | /* |
227 | * Stream Ioctl defines | | 229 | * Stream Ioctl defines |
228 | */ | | 230 | */ |
229 | #define STR ('S'<<8) | | 231 | #define STR ('S'<<8) |
230 | /* (STR|000) in use */ | | 232 | /* (STR|000) in use */ |
231 | #define I_NREAD (STR|01) | | 233 | #define I_NREAD (STR|01) |
232 | #define I_PUSH (STR|02) | | 234 | #define I_PUSH (STR|02) |
233 | #define I_POP (STR|03) | | 235 | #define I_POP (STR|03) |
234 | #define I_LOOK (STR|04) | | 236 | #define I_LOOK (STR|04) |
235 | #define I_FLUSH (STR|05) | | 237 | #define I_FLUSH (STR|05) |
236 | #define I_SRDOPT (STR|06) | | 238 | #define I_SRDOPT (STR|06) |
237 | #define I_GRDOPT (STR|07) | | 239 | #define I_GRDOPT (STR|07) |
238 | #define I_STR (STR|010) | | 240 | #define I_STR (STR|010) |
239 | #define I_SETSIG (STR|011) | | 241 | #define I_SETSIG (STR|011) |
240 | #define I_GETSIG (STR|012) | | 242 | #define I_GETSIG (STR|012) |
241 | #define I_FIND (STR|013) | | 243 | #define I_FIND (STR|013) |
242 | #define I_LINK (STR|014) | | 244 | #define I_LINK (STR|014) |
243 | #define I_UNLINK (STR|015) | | 245 | #define I_UNLINK (STR|015) |
244 | /* (STR|016) in use */ | | 246 | /* (STR|016) in use */ |
245 | #define I_PEEK (STR|017) | | 247 | #define I_PEEK (STR|017) |
246 | #define I_FDINSERT (STR|020) | | 248 | #define I_FDINSERT (STR|020) |
247 | #define I_SENDFD (STR|021) | | 249 | #define I_SENDFD (STR|021) |
248 | | | 250 | |
249 | #if defined(_KERNEL) | | 251 | #if defined(_KERNEL) |
250 | #define I_RECVFD (STR|022) | | 252 | #define I_RECVFD (STR|022) |
251 | #define I_E_RECVFD (STR|016) | | 253 | #define I_E_RECVFD (STR|016) |
252 | #else /* user level definition */ | | 254 | #else /* user level definition */ |
253 | #define I_RECVFD (STR|016) /* maps to kernel I_E_RECVFD */ | | 255 | #define I_RECVFD (STR|016) /* maps to kernel I_E_RECVFD */ |
254 | #endif /* defined(_KERNEL) */ | | 256 | #endif /* defined(_KERNEL) */ |
255 | | | 257 | |
256 | #define I_SWROPT (STR|023) | | 258 | #define I_SWROPT (STR|023) |
257 | #define I_GWROPT (STR|024) | | 259 | #define I_GWROPT (STR|024) |
258 | #define I_LIST (STR|025) | | 260 | #define I_LIST (STR|025) |
259 | #define I_PLINK (STR|026) | | 261 | #define I_PLINK (STR|026) |
260 | #define I_PUNLINK (STR|027) | | 262 | #define I_PUNLINK (STR|027) |
261 | #define I_ANCHOR (STR|030) | | 263 | #define I_ANCHOR (STR|030) |
262 | #define I_FLUSHBAND (STR|034) | | 264 | #define I_FLUSHBAND (STR|034) |
263 | #define I_CKBAND (STR|035) | | 265 | #define I_CKBAND (STR|035) |
264 | #define I_GETBAND (STR|036) | | 266 | #define I_GETBAND (STR|036) |
265 | #define I_ATMARK (STR|037) | | 267 | #define I_ATMARK (STR|037) |
266 | #define I_SETCLTIME (STR|040) | | 268 | #define I_SETCLTIME (STR|040) |
267 | #define I_GETCLTIME (STR|041) | | 269 | #define I_GETCLTIME (STR|041) |
268 | #define I_CANPUT (STR|042) | | 270 | #define I_CANPUT (STR|042) |
269 | #define I_SERROPT (STR|043) | | 271 | #define I_SERROPT (STR|043) |
270 | #define I_GERROPT (STR|044) | | 272 | #define I_GERROPT (STR|044) |
271 | #define I_ESETSIG (STR|045) | | 273 | #define I_ESETSIG (STR|045) |
272 | #define I_EGETSIG (STR|046) | | 274 | #define I_EGETSIG (STR|046) |
273 | | | 275 | |
274 | #define __I_PUSH_NOCTTY (STR|047) /* push module, no cntrl tty */ | | 276 | #define __I_PUSH_NOCTTY (STR|047) /* push module, no cntrl tty */ |
275 | | | 277 | |
276 | /* | | 278 | /* |
277 | * IOCTLs (STR|050) - (STR|055) are available for use. | | 279 | * IOCTLs (STR|050) - (STR|055) are available for use. |
278 | */ | | 280 | */ |
279 | | | 281 | |
280 | #define _I_MUXID2FD (STR|056) /* Private: get a fd from a muxid */ | | 282 | #define _I_MUXID2FD (STR|056) /* Private: get a fd from a muxid */ |
281 | #define _I_INSERT (STR|057) /* Private: insert a module */ | | 283 | #define _I_INSERT (STR|057) /* Private: insert a module */ |
282 | #define _I_REMOVE (STR|060) /* Private: remove a module */ | | 284 | #define _I_REMOVE (STR|060) /* Private: remove a module */ |
283 | #define _I_GETPEERCRED (STR|061) /* Private: get peer cred */ | | 285 | #define _I_GETPEERCRED (STR|061) /* Private: get peer cred */ |
284 | #define _I_PLINK_LH (STR|062) /* Private: Layered Driver ioctl */ | | 286 | #define _I_PLINK_LH (STR|062) /* Private: Layered Driver ioctl */ |
285 | #define _I_CMD (STR|063) /* Private: send ioctl via M_CMD */ | | 287 | #define _I_CMD (STR|063) /* Private: send ioctl via M_CMD */ |
286 | | | 288 | |
287 | /* | | 289 | /* |
288 | * User level ioctl format for ioctls that go downstream (I_STR) | | 290 | * User level ioctl format for ioctls that go downstream (I_STR) |
289 | */ | | 291 | */ |
290 | struct strioctl { | | 292 | struct strioctl { |
291 | int ic_cmd; /* command */ | | 293 | int ic_cmd; /* command */ |
292 | int ic_timout; /* timeout value */ | | 294 | int ic_timout; /* timeout value */ |
293 | int ic_len; /* length of data */ | | 295 | int ic_len; /* length of data */ |
294 | char *ic_dp; /* pointer to data */ | | 296 | char *ic_dp; /* pointer to data */ |
295 | }; | | 297 | }; |
296 | | | 298 | |
297 | #if defined(_SYSCALL32) | | 299 | #if defined(_SYSCALL32) |
298 | | | 300 | |
299 | struct strioctl32 { | | 301 | struct strioctl32 { |
300 | int32_t ic_cmd; /* command */ | | 302 | int32_t ic_cmd; /* command */ |
301 | int32_t ic_timout; /* timeout value */ | | 303 | int32_t ic_timout; /* timeout value */ |
302 | int32_t ic_len; /* length of data */ | | 304 | int32_t ic_len; /* length of data */ |
303 | caddr32_t ic_dp; /* pointer to data */ | | 305 | caddr32_t ic_dp; /* pointer to data */ |
304 | }; | | 306 | }; |
305 | | | 307 | |
306 | #endif /* _SYSCALL32 */ | | 308 | #endif /* _SYSCALL32 */ |
307 | | | 309 | |
308 | /* | | 310 | /* |
309 | * Value for timeouts (ioctl, select) that denotes infinity | | 311 | * Value for timeouts (ioctl, select) that denotes infinity |
310 | */ | | 312 | */ |
311 | #define _INFTIM -1 | | 313 | #define _INFTIM -1 |
312 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 314 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
313 | #define INFTIM _INFTIM | | 315 | #define INFTIM _INFTIM |
314 | #endif | | 316 | #endif |
315 | | | 317 | |
316 | #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) | | 318 | #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) |
317 | /* | | 319 | /* |
318 | * For _I_CMD: similar to strioctl, but with included buffer (to avoid copyin/ | | 320 | * For _I_CMD: similar to strioctl, but with included buffer (to avoid copyin/ |
319 | * copyout from another address space). NOTE: the size of this structure must | | 321 | * copyout from another address space). NOTE: the size of this structure must |
320 | * be less than libproc.h`MAXARGL for pr_ioctl() to handle it. | | 322 | * be less than libproc.h`MAXARGL for pr_ioctl() to handle it. |
321 | */ | | 323 | */ |
322 | #define STRCMDBUFSIZE 2048 | | 324 | #define STRCMDBUFSIZE 2048 |
323 | typedef struct strcmd { | | 325 | typedef struct strcmd { |
324 | int sc_cmd; /* ioctl command */ | | 326 | int sc_cmd; /* ioctl command */ |
325 | int sc_timeout; /* timeout value (in seconds) */ | | 327 | int sc_timeout; /* timeout value (in seconds) */ |
326 | int sc_len; /* length of data */ | | 328 | int sc_len; /* length of data */ |
327 | int sc_pad; | | 329 | int sc_pad; |
328 | char sc_buf[STRCMDBUFSIZE]; /* data buffer */ | | 330 | char sc_buf[STRCMDBUFSIZE]; /* data buffer */ |
329 | } strcmd_t; | | 331 | } strcmd_t; |
330 | #endif | | 332 | #endif |
331 | | | 333 | |
332 | /* | | 334 | /* |
333 | * Stream buffer structure for putmsg and getmsg system calls | | 335 | * Stream buffer structure for putmsg and getmsg system calls |
334 | */ | | 336 | */ |
335 | struct strbuf { | | 337 | struct strbuf { |
336 | int maxlen; /* no. of bytes in buffer */ | | 338 | int maxlen; /* no. of bytes in buffer */ |
337 | int len; /* no. of bytes returned */ | | 339 | int len; /* no. of bytes returned */ |
338 | caddr_t buf; /* pointer to data */ | | 340 | caddr_t buf; /* pointer to data */ |
339 | }; | | 341 | }; |
340 | | | 342 | |
341 | #if defined(_SYSCALL32) | | 343 | #if defined(_SYSCALL32) |
342 | | | 344 | |
343 | struct strbuf32 { | | 345 | struct strbuf32 { |
344 | int32_t maxlen; /* no. of bytes in buffer */ | | 346 | int32_t maxlen; /* no. of bytes in buffer */ |
345 | int32_t len; /* no. of bytes returned */ | | 347 | int32_t len; /* no. of bytes returned */ |
346 | caddr32_t buf; /* pointer to data */ | | 348 | caddr32_t buf; /* pointer to data */ |
347 | }; | | 349 | }; |
348 | #endif /* _SYSCALL32 */ | | 350 | #endif /* _SYSCALL32 */ |
349 | | | 351 | |
350 | /* | | 352 | /* |
351 | * Stream I_PEEK ioctl format | | 353 | * Stream I_PEEK ioctl format |
352 | */ | | 354 | */ |
353 | struct strpeek { | | 355 | struct strpeek { |
354 | struct strbuf ctlbuf; | | 356 | struct strbuf ctlbuf; |
355 | struct strbuf databuf; | | 357 | struct strbuf databuf; |
356 | t_uscalar_t flags; | | 358 | t_uscalar_t flags; |
357 | }; | | 359 | }; |
358 | | | 360 | |
359 | #if defined(_SYSCALL32) | | 361 | #if defined(_SYSCALL32) |
360 | | | 362 | |
361 | struct strpeek32 { | | 363 | struct strpeek32 { |
362 | struct strbuf32 ctlbuf; | | 364 | struct strbuf32 ctlbuf; |
363 | struct strbuf32 databuf; | | 365 | struct strbuf32 databuf; |
364 | uint32_t flags; | | 366 | uint32_t flags; |
365 | }; | | 367 | }; |
366 | | | 368 | |
367 | #endif /* _SYSCALL32 */ | | 369 | #endif /* _SYSCALL32 */ |
368 | | | 370 | |
369 | /* | | 371 | /* |
370 | * Stream I_FDINSERT ioctl format | | 372 | * Stream I_FDINSERT ioctl format |
371 | */ | | 373 | */ |
372 | struct strfdinsert { | | 374 | struct strfdinsert { |
373 | struct strbuf ctlbuf; | | 375 | struct strbuf ctlbuf; |
374 | struct strbuf databuf; | | 376 | struct strbuf databuf; |
375 | t_uscalar_t flags; | | 377 | t_uscalar_t flags; |
376 | int fildes; | | 378 | int fildes; |
377 | int offset; | | 379 | int offset; |
378 | }; | | 380 | }; |
379 | | | 381 | |
380 | #if defined(_SYSCALL32) | | 382 | #if defined(_SYSCALL32) |
381 | | | 383 | |
382 | struct strfdinsert32 { | | 384 | struct strfdinsert32 { |
383 | struct strbuf32 ctlbuf; | | 385 | struct strbuf32 ctlbuf; |
384 | struct strbuf32 databuf; | | 386 | struct strbuf32 databuf; |
385 | uint32_t flags; | | 387 | uint32_t flags; |
386 | int32_t fildes; | | 388 | int32_t fildes; |
387 | int32_t offset; | | 389 | int32_t offset; |
388 | }; | | 390 | }; |
389 | | | 391 | |
390 | #endif /* _SYSCALL32 */ | | 392 | #endif /* _SYSCALL32 */ |
391 | | | 393 | |
392 | /* | | 394 | /* |
393 | * Receive file descriptor structure | | 395 | * Receive file descriptor structure |
394 | */ | | 396 | */ |
395 | #if defined(_KERNEL) | | 397 | #if defined(_KERNEL) |
396 | | | 398 | |
397 | struct o_strrecvfd { /* SVR3 syscall structure */ | | 399 | struct o_strrecvfd { /* SVR3 syscall structure */ |
398 | int fd; | | 400 | int fd; |
399 | o_uid_t uid; /* always ushort */ | | 401 | o_uid_t uid; /* always ushort */ |
400 | o_gid_t gid; | | 402 | o_gid_t gid; |
401 | char fill[8]; | | 403 | char fill[8]; |
402 | }; | | 404 | }; |
403 | | | 405 | |
404 | /* | | 406 | /* |
405 | * Although EFT is enabled in the kernel we kept the following definition | | 407 | * Although EFT is enabled in the kernel we kept the following definition |
406 | * to support an EFT application on a 4.0 non-EFT system. | | 408 | * to support an EFT application on a 4.0 non-EFT system. |
407 | */ | | 409 | */ |
408 | struct k_strrecvfd { /* SVR4 expanded syscall interface structure */ | | 410 | struct k_strrecvfd { /* SVR4 expanded syscall interface structure */ |
409 | struct file *fp; | | 411 | struct file *fp; |
410 | uid_t uid; | | 412 | uid_t uid; |
411 | gid_t gid; | | 413 | gid_t gid; |
412 | char fill[8]; | | 414 | char fill[8]; |
413 | }; | | 415 | }; |
414 | | | 416 | |
415 | /* | | 417 | /* |
416 | * Private _I_GETPEERCRED data. | | 418 | * Private _I_GETPEERCRED data. |
417 | */ | | 419 | */ |
418 | | | 420 | |
419 | typedef struct k_peercred { | | 421 | typedef struct k_peercred { |
420 | cred_t *pc_cr; | | 422 | cred_t *pc_cr; |
421 | pid_t pc_cpid; | | 423 | pid_t pc_cpid; |
422 | } k_peercred_t; | | 424 | } k_peercred_t; |
423 | | | 425 | |
424 | #endif /* defined(_KERNEL) */ | | 426 | #endif /* defined(_KERNEL) */ |
425 | | | 427 | |
426 | struct strrecvfd { | | 428 | struct strrecvfd { |
427 | int fd; | | 429 | int fd; |
428 | uid_t uid; | | 430 | uid_t uid; |
429 | gid_t gid; | | 431 | gid_t gid; |
430 | #if defined(_XPG4_2) | | 432 | #if defined(_XPG4_2) |
431 | char __fill[8]; | | 433 | char __fill[8]; |
432 | #else | | 434 | #else |
433 | char fill[8]; | | 435 | char fill[8]; |
434 | #endif | | 436 | #endif |
435 | }; | | 437 | }; |
436 | | | 438 | |
437 | | | 439 | |
438 | /* | | 440 | /* |
439 | * For I_LIST ioctl. | | 441 | * For I_LIST ioctl. |
440 | */ | | 442 | */ |
441 | struct str_mlist { | | 443 | struct str_mlist { |
442 | char l_name[FMNAMESZ+1]; | | 444 | char l_name[FMNAMESZ+1]; |
443 | }; | | 445 | }; |
444 | | | 446 | |
445 | struct str_list { | | 447 | struct str_list { |
446 | int sl_nmods; | | 448 | int sl_nmods; |
447 | struct str_mlist *sl_modlist; | | 449 | struct str_mlist *sl_modlist; |
448 | }; | | 450 | }; |
449 | | | 451 | |
450 | #if defined(_SYSCALL32) | | 452 | #if defined(_SYSCALL32) |
451 | | | 453 | |
452 | struct str_list32 { | | 454 | struct str_list32 { |
453 | int32_t sl_nmods; | | 455 | int32_t sl_nmods; |
454 | caddr32_t sl_modlist; | | 456 | caddr32_t sl_modlist; |
455 | }; | | 457 | }; |
456 | | | 458 | |
457 | #endif /* _SYSCALL32 */ | | 459 | #endif /* _SYSCALL32 */ |
458 | | | 460 | |
459 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 461 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
460 | /* | | 462 | /* |
461 | * Private, for _I_INSERT/_I_REMOVE ioctl. | | 463 | * Private, for _I_INSERT/_I_REMOVE ioctl. |
462 | */ | | 464 | */ |
463 | struct strmodconf { | | 465 | struct strmodconf { |
464 | int pos; /* Position to be inserted/removed. */ | | 466 | int pos; /* Position to be inserted/removed. */ |
465 | caddr_t mod_name; /* Name of module. */ | | 467 | caddr_t mod_name; /* Name of module. */ |
466 | }; | | 468 | }; |
467 | | | 469 | |
468 | #if defined(_SYSCALL32) | | 470 | #if defined(_SYSCALL32) |
469 | | | 471 | |
470 | struct strmodconf32 { | | 472 | struct strmodconf32 { |
471 | int32_t pos; | | 473 | int32_t pos; |
472 | caddr32_t mod_name; | | 474 | caddr32_t mod_name; |
473 | }; | | 475 | }; |
474 | | | 476 | |
475 | #endif /* _SYSCALL32 */ | | 477 | #endif /* _SYSCALL32 */ |
476 | #endif /* (_XPG4_2) || defined(__EXTENSIONS__) */ | | 478 | #endif /* (_XPG4_2) || defined(__EXTENSIONS__) */ |
477 | | | 479 | |
478 | /* | | 480 | /* |
479 | * For I_FLUSHBAND ioctl. Describes the priority | | 481 | * For I_FLUSHBAND ioctl. Describes the priority |
480 | * band for which the operation applies. | | 482 | * band for which the operation applies. |
481 | */ | | 483 | */ |
482 | struct bandinfo { | | 484 | struct bandinfo { |
483 | unsigned char bi_pri; | | 485 | unsigned char bi_pri; |
484 | int bi_flag; | | 486 | int bi_flag; |
485 | }; | | 487 | }; |
486 | | | 488 | |
487 | | | 489 | |
488 | /* | | 490 | /* |
489 | * The argument for I_ESETSIG and I_EGETSIG ioctls. | | 491 | * The argument for I_ESETSIG and I_EGETSIG ioctls. |
490 | */ | | 492 | */ |
491 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) | | 493 | #if !defined(_XPG4_2) || defined(__EXTENSIONS__) |
492 | struct strsigset { | | 494 | struct strsigset { |
493 | pid_t ss_pid; /* pgrp if negative */ | | 495 | pid_t ss_pid; /* pgrp if negative */ |
494 | int ss_events; /* S_ events */ | | 496 | int ss_events; /* S_ events */ |
495 | }; | | 497 | }; |
496 | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ | | 498 | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ |
497 | | | 499 | |
498 | #ifdef _XPG4_2 | | 500 | #ifdef _XPG4_2 |
499 | #ifdef __PRAGMA_REDEFINE_EXTNAME | | 501 | #ifdef __PRAGMA_REDEFINE_EXTNAME |
500 | | | 502 | |
501 | #pragma redefine_extname putmsg __xpg4_putmsg | | 503 | #pragma redefine_extname putmsg __xpg4_putmsg |
502 | #pragma redefine_extname putpmsg __xpg4_putpmsg | | 504 | #pragma redefine_extname putpmsg __xpg4_putpmsg |
503 | | | 505 | |
504 | #else /* __PRAGMA_REDEFINE_EXTNAME */ | | 506 | #else /* __PRAGMA_REDEFINE_EXTNAME */ |
505 | | | 507 | |
506 | #define putmsg __xpg4_putmsg | | 508 | #define putmsg __xpg4_putmsg |
507 | #define putpmsg __xpg4_putpmsg | | 509 | #define putpmsg __xpg4_putpmsg |
508 | | | 510 | |
509 | #endif /* __PRAGMA_REDEFINE_EXTNAME */ | | 511 | #endif /* __PRAGMA_REDEFINE_EXTNAME */ |
510 | #endif /* _XPG4_2 */ | | 512 | #endif /* _XPG4_2 */ |
511 | | | 513 | |
512 | #ifdef __cplusplus | | 514 | #ifdef __cplusplus |
513 | } | | 515 | } |
514 | #endif | | 516 | #endif |
515 | | | 517 | |
516 | #endif /* _SYS_STROPTS_H */ | | 518 | #endif /* _SYS_STROPTS_H */ |