]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 1998-2019 Free Software Foundation, Inc. |
af69217f UD |
2 | This file is part of the GNU C Library. |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
af69217f UD |
8 | |
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
af69217f | 13 | |
41bdb6e2 | 14 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | License along with the GNU C Library; if not, see |
16 | <http://www.gnu.org/licenses/>. */ | |
af69217f | 17 | |
09c81ddf AJ |
18 | #ifndef _STROPTS_H |
19 | # error "Never include <bits/stropts.h> directly; use <stropts.h> instead." | |
20 | #endif | |
21 | ||
af69217f UD |
22 | #ifndef _BITS_STROPTS_H |
23 | #define _BITS_STROPTS_H 1 | |
24 | ||
25 | #include <bits/types.h> | |
26 | ||
27 | /* Macros used as `request' argument to `ioctl'. */ | |
58932876 UD |
28 | #define __SID ('S' << 8) |
29 | ||
30 | #define I_NREAD (__SID | 1) /* Counts the number of data bytes in the data | |
31 | block in the first message. */ | |
32 | #define I_PUSH (__SID | 2) /* Push STREAMS module onto top of the current | |
af69217f | 33 | STREAM, just below the STREAM head. */ |
58932876 | 34 | #define I_POP (__SID | 3) /* Remove STREAMS module from just below the |
af69217f | 35 | STREAM head. */ |
58932876 | 36 | #define I_LOOK (__SID | 4) /* Retrieve the name of the module just below |
af69217f UD |
37 | the STREAM head and place it in a character |
38 | string. */ | |
58932876 UD |
39 | #define I_FLUSH (__SID | 5) /* Flush all input and/or output. */ |
40 | #define I_SRDOPT (__SID | 6) /* Sets the read mode. */ | |
41 | #define I_GRDOPT (__SID | 7) /* Returns the current read mode setting. */ | |
42 | #define I_STR (__SID | 8) /* Construct an internal STREAMS `ioctl' | |
43 | message and send that message downstream. */ | |
44 | #define I_SETSIG (__SID | 9) /* Inform the STREAM head that the process | |
af69217f | 45 | wants the SIGPOLL signal issued. */ |
58932876 | 46 | #define I_GETSIG (__SID |10) /* Return the events for which the calling |
af69217f UD |
47 | process is currently registered to be sent |
48 | a SIGPOLL signal. */ | |
58932876 | 49 | #define I_FIND (__SID |11) /* Compares the names of all modules currently |
af69217f UD |
50 | present in the STREAM to the name pointed to |
51 | by `arg'. */ | |
58932876 UD |
52 | #define I_LINK (__SID |12) /* Connect two STREAMs. */ |
53 | #define I_UNLINK (__SID |13) /* Disconnects the two STREAMs. */ | |
54 | #define I_PEEK (__SID |15) /* Allows a process to retrieve the information | |
af69217f UD |
55 | in the first message on the STREAM head read |
56 | queue without taking the message off the | |
57 | queue. */ | |
58932876 | 58 | #define I_FDINSERT (__SID |16) /* Create a message from the specified |
af69217f UD |
59 | buffer(s), adds information about another |
60 | STREAM, and send the message downstream. */ | |
58932876 | 61 | #define I_SENDFD (__SID |17) /* Requests the STREAM associated with `fildes' |
af69217f UD |
62 | to send a message, containing a file |
63 | pointer, to the STREAM head at the other end | |
64 | of a STREAMS pipe. */ | |
58932876 UD |
65 | #define I_RECVFD (__SID |14) /* Non-EFT definition. */ |
66 | #define I_SWROPT (__SID |19) /* Set the write mode. */ | |
bba09d23 | 67 | #define I_GWROPT (__SID |20) /* Return the current write mode setting. */ |
58932876 | 68 | #define I_LIST (__SID |21) /* List all the module names on the STREAM, up |
af69217f | 69 | to and including the topmost driver name. */ |
58932876 UD |
70 | #define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent |
71 | link. */ | |
72 | #define I_PUNLINK (__SID |23) /* Disconnect the two STREAMs that were | |
73 | connected with a persistent link. */ | |
74 | #define I_FLUSHBAND (__SID |28) /* Flush only band specified. */ | |
75 | #define I_CKBAND (__SID |29) /* Check if the message of a given priority | |
af69217f UD |
76 | band exists on the STREAM head read |
77 | queue. */ | |
58932876 | 78 | #define I_GETBAND (__SID |30) /* Return the priority band of the first |
af69217f | 79 | message on the STREAM head read queue. */ |
58932876 UD |
80 | #define I_ATMARK (__SID |31) /* See if the current message on the STREAM |
81 | head read queue is "marked" by some module | |
82 | downstream. */ | |
83 | #define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when | |
af69217f UD |
84 | a STREAM is closing and there is data on |
85 | the write queues. */ | |
58932876 UD |
86 | #define I_GETCLTIME (__SID |33) /* Get current value for closing timeout. */ |
87 | #define I_CANPUT (__SID |34) /* Check if a certain band is writable. */ | |
af69217f UD |
88 | |
89 | ||
90 | /* Used in `I_LOOK' request. */ | |
58932876 | 91 | #define FMNAMESZ 8 /* compatibility w/UnixWare/Solaris. */ |
af69217f UD |
92 | |
93 | /* Flush options. */ | |
58932876 UD |
94 | #define FLUSHR 0x01 /* Flush read queues. */ |
95 | #define FLUSHW 0x02 /* Flush write queues. */ | |
96 | #define FLUSHRW 0x03 /* Flush read and write queues. */ | |
bba09d23 UD |
97 | #ifdef __USE_GNU |
98 | # define FLUSHBAND 0x04 /* Flush only specified band. */ | |
99 | #endif | |
af69217f UD |
100 | |
101 | /* Possible arguments for `I_SETSIG'. */ | |
58932876 | 102 | #define S_INPUT 0x0001 /* A message, other than a high-priority |
af69217f | 103 | message, has arrived. */ |
58932876 UD |
104 | #define S_HIPRI 0x0002 /* A high-priority message is present. */ |
105 | #define S_OUTPUT 0x0004 /* The write queue for normal data is no longer | |
af69217f | 106 | full. */ |
58932876 | 107 | #define S_MSG 0x0008 /* A STREAMS signal message that contains the |
af69217f UD |
108 | SIGPOLL signal reaches the front of the |
109 | STREAM head read queue. */ | |
58932876 UD |
110 | #define S_ERROR 0x0010 /* Notification of an error condition. */ |
111 | #define S_HANGUP 0x0020 /* Notification of a hangup. */ | |
112 | #define S_RDNORM 0x0040 /* A normal message has arrived. */ | |
113 | #define S_WRNORM S_OUTPUT | |
114 | #define S_RDBAND 0x0080 /* A message with a non-zero priority has | |
115 | arrived. */ | |
116 | #define S_WRBAND 0x0100 /* The write queue for a non-zero priority | |
117 | band is no longer full. */ | |
af69217f UD |
118 | #define S_BANDURG 0x0200 /* When used in conjunction with S_RDBAND, |
119 | SIGURG is generated instead of SIGPOLL when | |
120 | a priority message reaches the front of the | |
121 | STREAM head read queue. */ | |
122 | ||
123 | /* Option for `I_PEEK'. */ | |
58932876 | 124 | #define RS_HIPRI 0x01 /* Only look for high-priority messages. */ |
af69217f UD |
125 | |
126 | /* Options for `I_SRDOPT'. */ | |
58932876 UD |
127 | #define RNORM 0x0000 /* Byte-STREAM mode, the default. */ |
128 | #define RMSGD 0x0001 /* Message-discard mode. */ | |
129 | #define RMSGN 0x0002 /* Message-nondiscard mode. */ | |
130 | #define RPROTDAT 0x0004 /* Deliver the control part of a message as | |
af69217f | 131 | data. */ |
58932876 | 132 | #define RPROTDIS 0x0008 /* Discard the control part of a message, |
af69217f | 133 | delivering any data part. */ |
58932876 UD |
134 | #define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message |
135 | containing a control part is at the front | |
136 | of the STREAM head read queue. */ | |
bba09d23 UD |
137 | #ifdef __USE_GNU |
138 | # define RPROTMASK 0x001C /* The RPROT bits */ | |
139 | #endif | |
af69217f UD |
140 | |
141 | /* Possible mode for `I_SWROPT'. */ | |
58932876 | 142 | #define SNDZERO 0x001 /* Send a zero-length message downstream when a |
af69217f | 143 | `write' of 0 bytes occurs. */ |
bba09d23 UD |
144 | #ifdef __USE_GNU |
145 | # define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if | |
58932876 | 146 | sd_werror is set. */ |
bba09d23 | 147 | #endif |
af69217f UD |
148 | |
149 | /* Arguments for `I_ATMARK'. */ | |
58932876 UD |
150 | #define ANYMARK 0x01 /* Check if the message is marked. */ |
151 | #define LASTMARK 0x02 /* Check if the message is the last one marked | |
af69217f UD |
152 | on the queue. */ |
153 | ||
154 | /* Argument for `I_UNLINK'. */ | |
bba09d23 UD |
155 | #ifdef __USE_GNU |
156 | # define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM | |
af69217f | 157 | associated with `fildes'. */ |
bba09d23 | 158 | #endif |
af69217f UD |
159 | |
160 | ||
161 | /* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */ | |
58932876 UD |
162 | #define MSG_HIPRI 0x01 /* Send/receive high priority message. */ |
163 | #define MSG_ANY 0x02 /* Receive any message. */ | |
164 | #define MSG_BAND 0x04 /* Receive message from specified band. */ | |
165 | ||
166 | /* Values returned by getmsg and getpmsg */ | |
167 | #define MORECTL 1 /* More control information is left in | |
af69217f | 168 | message. */ |
58932876 | 169 | #define MOREDATA 2 /* More data is left in message. */ |
af69217f UD |
170 | |
171 | ||
172 | /* Structure used for the I_FLUSHBAND ioctl on streams. */ | |
173 | struct bandinfo | |
174 | { | |
175 | unsigned char bi_pri; | |
176 | int bi_flag; | |
177 | }; | |
178 | ||
179 | struct strbuf | |
180 | { | |
181 | int maxlen; /* Maximum buffer length. */ | |
182 | int len; /* Length of data. */ | |
183 | char *buf; /* Pointer to buffer. */ | |
184 | }; | |
185 | ||
186 | struct strpeek | |
187 | { | |
188 | struct strbuf ctlbuf; | |
189 | struct strbuf databuf; | |
bba09d23 | 190 | t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ |
af69217f UD |
191 | }; |
192 | ||
193 | struct strfdinsert | |
194 | { | |
195 | struct strbuf ctlbuf; | |
196 | struct strbuf databuf; | |
bba09d23 | 197 | t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ |
af69217f UD |
198 | int fildes; |
199 | int offset; | |
200 | }; | |
201 | ||
202 | struct strioctl | |
203 | { | |
204 | int ic_cmd; | |
205 | int ic_timout; | |
206 | int ic_len; | |
207 | char *ic_dp; | |
208 | }; | |
209 | ||
210 | struct strrecvfd | |
211 | { | |
212 | int fd; | |
bba09d23 UD |
213 | uid_t uid; |
214 | gid_t gid; | |
215 | char __fill[8]; /* UnixWare/Solaris compatibility */ | |
af69217f UD |
216 | }; |
217 | ||
218 | ||
219 | struct str_mlist | |
220 | { | |
221 | char l_name[FMNAMESZ + 1]; | |
222 | }; | |
223 | ||
224 | struct str_list | |
225 | { | |
226 | int sl_nmods; | |
227 | struct str_mlist *sl_modlist; | |
228 | }; | |
229 | ||
230 | #endif /* bits/stropts.h */ |