home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / GCC 1.37.1r14 / BSD #includes / (include) / stropts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-27  |  2.9 KB  |  140 lines  |  [TEXT/UNIX]

  1. /*    @(#)stropts.h 1.7 88/02/08 SMI; from S5R3 sys/stropts.h 10.7    */
  2.  
  3. /*    Copyright (c) 1984 AT&T    */
  4. /*      All Rights Reserved      */
  5.  
  6. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. /*
  11.  * Read options
  12.  */
  13.  
  14. #define RNORM    0            /* read msg norm */
  15. #define RMSGD    1            /* read msg discard */
  16. #define RMSGN    2            /* read msg no discard */
  17.  
  18. /*
  19.  * Flush options
  20.  */
  21.  
  22. #define FLUSHR    1            /* flush read queue */
  23. #define FLUSHW    2            /* flush write queue */
  24. #define FLUSHRW    3            /* flush both queues */
  25.  
  26. /*
  27.  * Events for which to be sent SIGPOLL signal
  28.  */
  29. #define S_INPUT        001        /* regular priority msg on read Q */
  30. #define S_HIPRI        002        /* high priority msg on read Q */
  31. #define S_OUTPUT    004        /* write Q no longer full */
  32. #define S_MSG        010        /* signal msg at front of read Q */
  33.  
  34. /*
  35.  * Flags for recv() and send() syscall arguments
  36.  */
  37. #define RS_HIPRI    1        /* send/recv high priority message */
  38.  
  39. /*
  40.  * Flags returned as value of recv() syscall
  41.  */
  42. #define MORECTL        1        /* more ctl info is left in message */
  43. #define MOREDATA    2        /* more data is left in message */
  44.  
  45. #ifndef FMNAMESZ
  46. #define    FMNAMESZ    8
  47. #endif
  48.  
  49. #include <sys/ioccom.h>
  50.  
  51. /*
  52.  *  Stream Ioctl defines
  53.  */
  54. #define I_NREAD        _IOR('S',01,int)
  55. #define I_PUSH        _IOWN('S',02,FMNAMESZ+1)
  56. #define I_POP        _IO('S',03)
  57. #define I_LOOK        _IORN('S',04,FMNAMESZ+1)
  58. #define I_FLUSH        _IO('S',05)
  59. #define I_SRDOPT    _IO('S',06)
  60. #define I_GRDOPT    _IOR('S',07,int)
  61. #define I_STR        _IOWR('S',010,struct strioctl)
  62. #define I_SETSIG    _IO('S',011)
  63. #define I_GETSIG    _IOR('S',012,int)
  64. #define I_FIND        _IOWN('S',013,FMNAMESZ+1)
  65. #define I_LINK        _IO('S',014)
  66. #define I_UNLINK    _IO('S',015)
  67. #define I_PEEK        _IOWR('S',017,struct strpeek)
  68. #define I_FDINSERT    _IOW('S',020,struct strfdinsert)
  69. #define I_SENDFD    _IO('S',021)
  70. #define I_RECVFD    _IOR('S',022,struct strrecvfd)
  71. #define I_PLINK        _IO('S',023)
  72. #define I_PUNLINK    _IO('S',024)
  73.  
  74.  
  75. /*
  76.  * User level ioctl format for ioctl that go downstream I_STR 
  77.  */
  78. struct strioctl {
  79.     int     ic_cmd;            /* command */
  80.     int    ic_timout;        /* timeout value */
  81.     int    ic_len;            /* length of data */
  82.     char    *ic_dp;            /* pointer to data */
  83. };
  84.  
  85.  
  86. /*
  87.  * Value for timeouts (ioctl, select) that denotes infinity
  88.  */
  89. #define INFTIM        -1
  90.  
  91.  
  92. /*
  93.  * Stream buffer structure for send and recv system calls
  94.  */
  95. struct strbuf {
  96.     int    maxlen;            /* no. of bytes in buffer */
  97.     int    len;            /* no. of bytes returned */
  98.     char    *buf;            /* pointer to data */
  99. };
  100.  
  101.  
  102. /* 
  103.  * stream I_PEEK ioctl format
  104.  */
  105.  
  106. struct strpeek {
  107.     struct strbuf ctlbuf;
  108.     struct strbuf databuf;
  109.     long          flags;
  110. };
  111.  
  112. /*
  113.  * stream I_FDINSERT ioctl format
  114.  */
  115. struct strfdinsert {
  116.     struct strbuf ctlbuf;
  117.     struct strbuf databuf;
  118.     long          flags;
  119.     int          fildes;
  120.     int          offset;
  121. };
  122.  
  123.  
  124. /*
  125.  * receive file descriptor structure
  126.  */
  127. struct strrecvfd {
  128. #ifdef KERNEL
  129.     union {
  130.         struct file *fp;
  131.         int fd;
  132.     } f;
  133. #else
  134.     int fd;
  135. #endif
  136.     unsigned short uid;
  137.     unsigned short gid;
  138.     char fill[8];
  139. };
  140.