home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / msg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  2.6 KB  |  112 lines

  1.  
  2. /*
  3.  *    @(#) msg.h 2.1 88/05/18 
  4.  *
  5.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987.
  6.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987.
  7.  *    This Module contains Proprietary Information of
  8.  *    The Santa Cruz Operation, Microsoft Corporation
  9.  *    and AT&T, and should be treated as Confidential.
  10.  */
  11.  
  12. /*
  13.  * THIS FILE CONTAINS CODE WHICH IS SPECIFIC TO THE
  14.  * INTEL 80286 CPU AND MAY REQUIRE MODIFICATION
  15.  * WHEN ADAPTING XENIX TO NEW HARDWARE.
  16.  */
  17.  
  18. /*
  19.  *    IPC Message Facility.
  20.  */
  21.  
  22. /*
  23. **    Implementation Constants.
  24. */
  25.  
  26. #define    PMSG    (PZERO + 2)    /* message facility sleep priority */
  27.  
  28. /*
  29. **    Permission Definitions.
  30. */
  31.  
  32. #define    MSG_R    0400    /* read permission */
  33. #define    MSG_W    0200    /* write permission */
  34.  
  35. /*
  36. **    ipc_perm Mode Definitions.
  37. */
  38.  
  39. #define    MSG_RWAIT    01000    /* a reader is waiting for a message */
  40. #define    MSG_WWAIT    02000    /* a writer is waiting to send */
  41.  
  42. /*
  43. **    Message Operation Flags.
  44. */
  45.  
  46. #define    MSG_NOERROR    010000    /* no error if big message */
  47.  
  48. /*
  49. **    Structure Definitions.
  50. */
  51.  
  52. /*
  53. **    There is one msg queue id data structure for each q in the system.
  54. */
  55.  
  56. struct msqid_ds {
  57.     struct ipc_perm    msg_perm;    /* operation permission struct */
  58. #ifdef M_I386
  59.     struct msg     *msg_first;    /* ptr to first message on q */
  60.     struct msg     *msg_last;    /* ptr to last message on q */
  61. #else
  62.     struct msg near *msg_first;    /* ptr to first message on q */
  63.     struct msg near *msg_last;    /* ptr to last message on q */
  64. #endif
  65.     ushort        msg_cbytes;    /* current # bytes on q */
  66.     ushort        msg_qnum;    /* # of messages on q */
  67.     ushort        msg_qbytes;    /* max # of bytes on q */
  68.     ushort        msg_lspid;    /* pid of last msgsnd */
  69.     ushort        msg_lrpid;    /* pid of last msgrcv */
  70.     time_t        msg_stime;    /* last msgsnd time */
  71.     time_t        msg_rtime;    /* last msgrcv time */
  72.     time_t        msg_ctime;    /* last change time */
  73. };
  74.  
  75. /*
  76. **    There is one msg structure for each message that may be in the system.
  77. */
  78.  
  79. struct msg {
  80. #ifdef M_I386
  81.     struct msg     *msg_next;    /* ptr to next message on q */
  82. #else
  83.     struct msg near *msg_next;    /* ptr to next message on q */
  84. #endif
  85.     long        msg_type;    /* message type */
  86.     short        msg_ts;        /* message text size */
  87.     short        msg_spot;    /* message text map address */
  88. };
  89.  
  90. /*
  91. **    User message buffer template for msgsnd and msgrcv system calls.
  92. */
  93.  
  94. struct msgbuf {
  95.     long    mtype;        /* message type */
  96.     char    mtext[1];    /* message text */
  97. };
  98.  
  99. /*
  100. **    Message information structure.
  101. */
  102.  
  103. struct msginfo {
  104.     int    msgmap,    /* # of entries in msg map */
  105.         msgmax,    /* max message size */
  106.         msgmnb,    /* max # bytes on queue */
  107.         msgmni,    /* # of message queue identifiers */
  108.         msgssz,    /* msg segment size (should be word size multiple) */
  109.         msgtql;    /* # of system message headers */
  110.     ushort    msgseg;    /* # of msg segments (MUST BE < 32768) */
  111. };
  112.