3 Copyright 2002 Red Hat Inc.
4 Written by Conrad Scott <conrad.scott@dsl.pipex.com>
6 This file is part of Cygwin.
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
15 #include <cygwin/ipc.h>
22 /* Message operation flags:
24 #define MSG_NOERROR 0x01 /* No error if big message. */
27 /* Command definitions for the semctl () function:
29 #define MSG_STAT 0x2000 /* For ipcs(8) */
30 #define MSG_INFO 0x2001 /* For ipcs(8) */
33 /* Used for the number of messages in the message queue.
35 typedef unsigned long msgqnum_t;
37 /* Used for the number of bytes allowed in a message queue.
39 typedef unsigned long msglen_t;
43 struct ipc_perm msg_perm; /* Operation permission structure. */
44 msglen_t msg_cbytes; /* Number of bytes currently on queue. */
45 msgqnum_t msg_qnum; /* Number of messages currently on queue. */
46 msglen_t msg_qbytes; /* Maximum number of bytes allowed on queue. */
47 pid_t msg_lspid; /* Process ID of last msgsnd (). */
48 pid_t msg_lrpid; /* Process ID of last msgrcv (). */
49 timestruc_t msg_stim; /* Time of last msgsnd (). */
50 timestruc_t msg_rtim; /* Time of last msgrcv (). */
51 timestruc_t msg_ctim; /* Time of last change. */
53 struct msg *msg_first;
60 #define msg_stime msg_stim.tv_sec
61 #define msg_rtime msg_rtim.tv_sec
62 #define msg_ctime msg_ctim.tv_sec
65 /* Buffer type for msgctl (IPC_INFO, ...) as used by ipcs(8).
69 long msgmax; /* Maximum number of bytes per
71 long msgmnb; /* Maximum number of bytes on any one
73 long msgmni; /* Maximum number of message queues,
75 long msgtql; /* Maximum number of messages, system
77 long msgssz; /* Size of a message segment, must be
78 small power of 2 greater than 4. */
79 long msgseg; /* Number of message segments */
83 /* Buffer type for msgctl (MSG_INFO, ...) as used by ipcs(8).
87 long msg_ids; /* Number of allocated queues. */
88 long msg_num; /* Number of messages, system wide. */
89 long msg_tot; /* Size in bytes of messages, system wide. */
93 int msgctl (int msqid, int cmd, struct msqid_ds *buf);
94 int msgget (key_t key, int msgflg);
95 ssize_t msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg);
96 int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg);
102 #endif /* _CYGWIN_MSG_H */