stropts.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #ifndef _STROPTS_H
  2. #define _STROPTS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define __SID ('S' << 8)
  7. #define I_NREAD (__SID | 1)
  8. #define I_PUSH (__SID | 2)
  9. #define I_POP (__SID | 3)
  10. #define I_LOOK (__SID | 4)
  11. #define I_FLUSH (__SID | 5)
  12. #define I_SRDOPT (__SID | 6)
  13. #define I_GRDOPT (__SID | 7)
  14. #define I_STR (__SID | 8)
  15. #define I_SETSIG (__SID | 9)
  16. #define I_GETSIG (__SID |10)
  17. #define I_FIND (__SID |11)
  18. #define I_LINK (__SID |12)
  19. #define I_UNLINK (__SID |13)
  20. #define I_PEEK (__SID |15)
  21. #define I_FDINSERT (__SID |16)
  22. #define I_SENDFD (__SID |17)
  23. #define I_RECVFD (__SID |14)
  24. #define I_SWROPT (__SID |19)
  25. #define I_GWROPT (__SID |20)
  26. #define I_LIST (__SID |21)
  27. #define I_PLINK (__SID |22)
  28. #define I_PUNLINK (__SID |23)
  29. #define I_FLUSHBAND (__SID |28)
  30. #define I_CKBAND (__SID |29)
  31. #define I_GETBAND (__SID |30)
  32. #define I_ATMARK (__SID |31)
  33. #define I_SETCLTIME (__SID |32)
  34. #define I_GETCLTIME (__SID |33)
  35. #define I_CANPUT (__SID |34)
  36. #define FMNAMESZ 8
  37. #define FLUSHR 0x01
  38. #define FLUSHW 0x02
  39. #define FLUSHRW 0x03
  40. #define FLUSHBAND 0x04
  41. #define S_INPUT 0x0001
  42. #define S_HIPRI 0x0002
  43. #define S_OUTPUT 0x0004
  44. #define S_MSG 0x0008
  45. #define S_ERROR 0x0010
  46. #define S_HANGUP 0x0020
  47. #define S_RDNORM 0x0040
  48. #define S_WRNORM S_OUTPUT
  49. #define S_RDBAND 0x0080
  50. #define S_WRBAND 0x0100
  51. #define S_BANDURG 0x0200
  52. #define RS_HIPRI 0x01
  53. #define RNORM 0x0000
  54. #define RMSGD 0x0001
  55. #define RMSGN 0x0002
  56. #define RPROTDAT 0x0004
  57. #define RPROTDIS 0x0008
  58. #define RPROTNORM 0x0010
  59. #define RPROTMASK 0x001C
  60. #define SNDZERO 0x001
  61. #define SNDPIPE 0x002
  62. #define ANYMARK 0x01
  63. #define LASTMARK 0x02
  64. #define MUXID_ALL (-1)
  65. #define MSG_HIPRI 0x01
  66. #define MSG_ANY 0x02
  67. #define MSG_BAND 0x04
  68. #define MORECTL 1
  69. #define MOREDATA 2
  70. struct bandinfo {
  71. unsigned char bi_pri;
  72. int bi_flag;
  73. };
  74. struct strbuf {
  75. int maxlen;
  76. int len;
  77. char *buf;
  78. };
  79. struct strpeek {
  80. struct strbuf ctlbuf;
  81. struct strbuf databuf;
  82. unsigned flags;
  83. };
  84. struct strfdinsert {
  85. struct strbuf ctlbuf;
  86. struct strbuf databuf;
  87. unsigned flags;
  88. int fildes;
  89. int offset;
  90. };
  91. struct strioctl {
  92. int ic_cmd;
  93. int ic_timout;
  94. int ic_len;
  95. char *ic_dp;
  96. };
  97. struct strrecvfd {
  98. int fd;
  99. int uid;
  100. int gid;
  101. char __fill[8];
  102. };
  103. struct str_mlist {
  104. char l_name[FMNAMESZ + 1];
  105. };
  106. struct str_list {
  107. int sl_nmods;
  108. struct str_mlist *sl_modlist;
  109. };
  110. int isastream(int);
  111. int ioctl(int, int, ...);
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115. #endif