home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / stropts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  3.3 KB  |  155 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8.  
  9. #ident    "@(#)head.sys:stropts.h    1.4"
  10.  
  11. /*
  12.  * Read options
  13.  */
  14.  
  15. #define RNORM 0                /* read msg norm */
  16. #define RMSGD    1            /* read msg discard */
  17. #define RMSGN    2            /* read msg no discard */
  18.  
  19. /*
  20.  * Flush options
  21.  */
  22.  
  23. #define FLUSHR 1            /* flush read queue */
  24. #define FLUSHW 2            /* flush write queue */
  25. #define FLUSHRW 3            /* flush both queues */
  26.  
  27. /*
  28.  * Events for which to be sent SIGPOLL signal
  29.  */
  30. #define S_INPUT        001        /* regular priority msg on read Q */
  31. #define S_HIPRI        002        /* high priority msg on read Q */
  32. #define S_OUTPUT    004        /* write Q no longer full */
  33. #define S_MSG        010        /* signal msg at front of read Q */
  34.  
  35. /*
  36.  * Flags for recv() and send() syscall arguments
  37.  */
  38. #define RS_HIPRI    1        /* send/recv high priority message */
  39.  
  40. /*
  41.  * Flags returned as value of recv() syscall
  42.  */
  43. #define MORECTL        1        /* more ctl info is left in message */
  44. #define MOREDATA    2        /* more data is left in message */
  45.  
  46. /*
  47.  *  Stream Ioctl defines
  48.  */
  49. #define    STR        ('S'<<8)
  50. #define I_NREAD        (STR|01)
  51. #define I_PUSH        (STR|02)
  52. #define I_POP        (STR|03)
  53. #define I_LOOK        (STR|04)
  54. #define I_FLUSH        (STR|05)
  55. #define I_SRDOPT    (STR|06)
  56. #define I_GRDOPT    (STR|07)
  57. #define I_STR        (STR|010)
  58. #define I_SETSIG    (STR|011)
  59. #define I_GETSIG    (STR|012)
  60. #define I_FIND        (STR|013)
  61. #define I_LINK        (STR|014)
  62. #define I_UNLINK    (STR|015)
  63. #define I_PEEK        (STR|017)
  64. #define I_FDINSERT    (STR|020)
  65. #define I_SENDFD    (STR|021)
  66. #define I_RECVFD    (STR|022)
  67.  
  68.                         /* Same ioctl as O_MODESWITCH */
  69. #define    X_STR            ('S'<<8)    /* SCO XENIX Streams ioctl's */
  70. #define    X_I_BASE        (X_STR|0200)
  71. #define    X_I_NREAD        (X_STR|0201)
  72. #define    X_I_PUSH        (X_STR|0202)
  73. #define    X_I_POP            (X_STR|0203)
  74. #define    X_I_LOOK        (X_STR|0204)
  75. #define    X_I_FLUSH        (X_STR|0205)
  76. #define    X_I_SRDOPT        (X_STR|0206)
  77. #define    X_I_GRDOPT        (X_STR|0207)
  78. #define    X_I_STR            (X_STR|0210)
  79. #define    X_I_SETSIG        (X_STR|0211)
  80. #define    X_I_GETSIG        (X_STR|0212)
  81. #define    X_I_FIND        (X_STR|0213)
  82. #define    X_I_LINK        (X_STR|0214)
  83. #define    X_I_UNLINK        (X_STR|0215)
  84. #define    X_I_PEEK        (X_STR|0217)
  85. #define    X_I_FDINSERT        (X_STR|0220)
  86. #define    X_I_SENDFD        (X_STR|0221)
  87. #define    X_I_RECVFD        (X_STR|0222)
  88.     
  89. /*
  90.  * User level ioctl format for ioctl that go downstream I_STR 
  91.  */
  92. struct strioctl {
  93.     int     ic_cmd;            /* command */
  94.     int    ic_timout;        /* timeout value */
  95.     int    ic_len;            /* length of data */
  96.     char    *ic_dp;            /* pointer to data */
  97. };
  98.  
  99.  
  100. /*
  101.  * Value for timeouts (ioctl, select) that denotes infinity
  102.  */
  103. #define INFTIM        -1
  104.  
  105.  
  106. /*
  107.  * Stream buffer structure for send and recv system calls
  108.  */
  109. struct strbuf {
  110.     int    maxlen;            /* no. of bytes in buffer */
  111.     int    len;            /* no. of bytes returned */
  112.     char    *buf;            /* pointer to data */
  113. };
  114.  
  115.  
  116. /* 
  117.  * stream I_PEEK ioctl format
  118.  */
  119.  
  120. struct strpeek {
  121.     struct strbuf ctlbuf;
  122.     struct strbuf databuf;
  123.     long          flags;
  124. };
  125.  
  126. /*
  127.  * stream I_FDINSERT ioctl format
  128.  */
  129. struct strfdinsert {
  130.     struct strbuf ctlbuf;
  131.     struct strbuf databuf;
  132.     long          flags;
  133.     int          fildes;
  134.     int          offset;
  135. };
  136.  
  137.  
  138. /*
  139.  * receive file descriptor structure
  140.  */
  141. struct strrecvfd {
  142. #ifdef INKERNEL
  143.     union {
  144.         struct file *fp;
  145.         int fd;
  146.     } f;
  147. #else
  148.     int fd;
  149. #endif
  150.     unsigned short uid;
  151.     unsigned short gid;
  152.     char fill[8];
  153. };
  154.  
  155.