June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. 002: This file is part of the GNU C Library. 003: 004: The GNU C Library is free software; you can redistribute it and/or 005: modify it under the terms of the GNU Lesser General Public 006: License as published by the Free Software Foundation; either 007: version 2.1 of the License, or (at your option) any later version. 008: 009: The GNU C Library is distributed in the hope that it will be useful, 010: but WITHOUT ANY WARRANTY; without even the implied warranty of 011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012: Lesser General Public License for more details. 013: 014: You should have received a copy of the GNU Lesser General Public 015: License along with the GNU C Library; if not, write to the Free 016: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 017: 02111-1307 USA. */ 018: 019: #ifndef _STROPTS_H 020: # error "Never include <bits/stropts.h> directly; use <stropts.h> instead." 021: #endif 022: 023: #ifndef _BITS_STROPTS_H 024: #define _BITS_STROPTS_H 1 025: 026: #include <bits/types.h> 027: 028: /* Macros used as `request' argument to `ioctl'. */ 029: #define __SID ('S' << 8) 030: 031: #define I_NREAD (__SID | 1) /* Counts the number of data bytes in the data 032: block in the first message. */ 033: #define I_PUSH (__SID | 2) /* Push STREAMS module onto top of the current 034: STREAM, just below the STREAM head. */ 035: #define I_POP (__SID | 3) /* Remove STREAMS module from just below the 036: STREAM head. */ 037: #define I_LOOK (__SID | 4) /* Retrieve the name of the module just below 038: the STREAM head and place it in a character 039: string. */ 040: #define I_FLUSH (__SID | 5) /* Flush all input and/or output. */ 041: #define I_SRDOPT (__SID | 6) /* Sets the read mode. */ 042: #define I_GRDOPT (__SID | 7) /* Returns the current read mode setting. */ 043: #define I_STR (__SID | 8) /* Construct an internal STREAMS `ioctl' 044: message and send that message downstream. */ 045: #define I_SETSIG (__SID | 9) /* Inform the STREAM head that the process 046: wants the SIGPOLL signal issued. */ 047: #define I_GETSIG (__SID |10) /* Return the events for which the calling 048: process is currently registered to be sent 049: a SIGPOLL signal. */ 050: #define I_FIND (__SID |11) /* Compares the names of all modules currently 051: present in the STREAM to the name pointed to 052: by `arg'. */ 053: #define I_LINK (__SID |12) /* Connect two STREAMs. */ 054: #define I_UNLINK (__SID |13) /* Disconnects the two STREAMs. */ 055: #define I_PEEK (__SID |15) /* Allows a process to retrieve the information 056: in the first message on the STREAM head read 057: queue without taking the message off the 058: queue. */ 059: #define I_FDINSERT (__SID |16) /* Create a message from the specified 060: buffer(s), adds information about another 061: STREAM, and send the message downstream. */ 062: #define I_SENDFD (__SID |17) /* Requests the STREAM associated with `fildes' 063: to send a message, containing a file 064: pointer, to the STREAM head at the other end 065: of a STREAMS pipe. */ 066: #define I_RECVFD (__SID |14) /* Non-EFT definition. */ 067: #define I_SWROPT (__SID |19) /* Set the write mode. */ 068: #define I_GWROPT (__SID |20) /* Return the current write mode setting. */ 069: #define I_LIST (__SID |21) /* List all the module names on the STREAM, up 070: to and including the topmost driver name. */ 071: #define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent 072: link. */ 073: #define I_PUNLINK (__SID |23) /* Disconnect the two STREAMs that were 074: connected with a persistent link. */ 075: #define I_FLUSHBAND (__SID |28) /* Flush only band specified. */ 076: #define I_CKBAND (__SID |29) /* Check if the message of a given priority 077: band exists on the STREAM head read 078: queue. */ 079: #define I_GETBAND (__SID |30) /* Return the priority band of the first 080: message on the STREAM head read queue. */ 081: #define I_ATMARK (__SID |31) /* See if the current message on the STREAM 082: head read queue is "marked" by some module 083: downstream. */ 084: #define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when 085: a STREAM is closing and there is data on 086: the write queues. */ 087: #define I_GETCLTIME (__SID |33) /* Get current value for closing timeout. */ 088: #define I_CANPUT (__SID |34) /* Check if a certain band is writable. */ 089: 090: 091: /* Used in `I_LOOK' request. */ 092: #define FMNAMESZ 8 /* compatibility w/UnixWare/Solaris. */ 093: 094: /* Flush options. */ 095: #define FLUSHR 0x01 /* Flush read queues. */ 096: #define FLUSHW 0x02 /* Flush write queues. */ 097: #define FLUSHRW 0x03 /* Flush read and write queues. */ 098: #ifdef __USE_GNU 099: # define FLUSHBAND 0x04 /* Flush only specified band. */ 100: #endif 101: 102: /* Possible arguments for `I_SETSIG'. */ 103: #define S_INPUT 0x0001 /* A message, other than a high-priority 104: message, has arrived. */ 105: #define S_HIPRI 0x0002 /* A high-priority message is present. */ 106: #define S_OUTPUT 0x0004 /* The write queue for normal data is no longer 107: full. */ 108: #define S_MSG 0x0008 /* A STREAMS signal message that contains the 109: SIGPOLL signal reaches the front of the 110: STREAM head read queue. */ 111: #define S_ERROR 0x0010 /* Notification of an error condition. */ 112: #define S_HANGUP 0x0020 /* Notification of a hangup. */ 113: #define S_RDNORM 0x0040 /* A normal message has arrived. */ 114: #define S_WRNORM S_OUTPUT 115: #define S_RDBAND 0x0080 /* A message with a non-zero priority has 116: arrived. */ 117: #define S_WRBAND 0x0100 /* The write queue for a non-zero priority 118: band is no longer full. */ 119: #define S_BANDURG 0x0200 /* When used in conjunction with S_RDBAND, 120: SIGURG is generated instead of SIGPOLL when 121: a priority message reaches the front of the 122: STREAM head read queue. */ 123: 124: /* Option for `I_PEEK'. */ 125: #define RS_HIPRI 0x01 /* Only look for high-priority messages. */ 126: 127: /* Options for `I_SRDOPT'. */ 128: #define RNORM 0x0000 /* Byte-STREAM mode, the default. */ 129: #define RMSGD 0x0001 /* Message-discard mode. */ 130: #define RMSGN 0x0002 /* Message-nondiscard mode. */ 131: #define RPROTDAT 0x0004 /* Deliver the control part of a message as 132: data. */ 133: #define RPROTDIS 0x0008 /* Discard the control part of a message, 134: delivering any data part. */ 135: #define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message 136: containing a control part is at the front 137: of the STREAM head read queue. */ 138: #ifdef __USE_GNU 139: # define RPROTMASK 0x001C /* The RPROT bits */ 140: #endif 141: 142: /* Possible mode for `I_SWROPT'. */ 143: #define SNDZERO 0x001 /* Send a zero-length message downstream when a 144: `write' of 0 bytes occurs. */ 145: #ifdef __USE_GNU 146: # define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if 147: sd_werror is set. */ 148: #endif 149: 150: /* Arguments for `I_ATMARK'. */ 151: #define ANYMARK 0x01 /* Check if the message is marked. */ 152: #define LASTMARK 0x02 /* Check if the message is the last one marked 153: on the queue. */ 154: 155: /* Argument for `I_UNLINK'. */ 156: #ifdef __USE_GNU 157: # define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM 158: associated with `fildes'. */ 159: #endif 160: 161: 162: /* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */ 163: #define MSG_HIPRI 0x01 /* Send/receive high priority message. */ 164: #define MSG_ANY 0x02 /* Receive any message. */ 165: #define MSG_BAND 0x04 /* Receive message from specified band. */ 166: 167: /* Values returned by getmsg and getpmsg */ 168: #define MORECTL 1 /* More control information is left in 169: message. */ 170: #define MOREDATA 2 /* More data is left in message. */ 171: 172: 173: /* Structure used for the I_FLUSHBAND ioctl on streams. */ 174: struct bandinfo 175: { 176: unsigned char bi_pri; 177: int bi_flag; 178: }; 179: 180: struct strbuf 181: { 182: int maxlen; /* Maximum buffer length. */ 183: int len; /* Length of data. */ 184: char *buf; /* Pointer to buffer. */ 185: }; 186: 187: struct strpeek 188: { 189: struct strbuf ctlbuf; 190: struct strbuf databuf; 191: t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ 192: }; 193: 194: struct strfdinsert 195: { 196: struct strbuf ctlbuf; 197: struct strbuf databuf; 198: t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ 199: int fildes; 200: int offset; 201: }; 202: 203: struct strioctl 204: { 205: int ic_cmd; 206: int ic_timout; 207: int ic_len; 208: char *ic_dp; 209: }; 210: 211: struct strrecvfd 212: { 213: int fd; 214: uid_t uid; 215: gid_t gid; 216: char __fill[8]; /* UnixWare/Solaris compatibility */ 217: }; 218: 219: 220: struct str_mlist 221: { 222: char l_name[FMNAMESZ + 1]; 223: }; 224: 225: struct str_list 226: { 227: int sl_nmods; 228: struct str_mlist *sl_modlist; 229: }; 230: 231: #endif /* bits/stropts.h */ 232: