* better
[mascara-docs.git] / i386 / linux-2.3.21 / include / linux / msg.h
blob2d42361b1b55e671f67a21841f0e090f80462a9e
1 #ifndef _LINUX_MSG_H
2 #define _LINUX_MSG_H
4 #include <linux/ipc.h>
6 /* ipcs ctl commands */
7 #define MSG_STAT 11
8 #define MSG_INFO 12
10 /* msgrcv options */
11 #define MSG_NOERROR 010000 /* no error if message is too big */
12 #define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
14 struct msqid_ds {
15 struct ipc_perm msg_perm;
16 struct msg *msg_first; /* first message on queue,unused */
17 struct msg *msg_last; /* last message in queue,unused */
18 __kernel_time_t msg_stime; /* last msgsnd time */
19 __kernel_time_t msg_rtime; /* last msgrcv time */
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
22 unsigned long msg_lqbytes; /* ditto */
23 unsigned short msg_cbytes; /* current number of bytes on queue */
24 unsigned short msg_qnum; /* number of messages in queue */
25 unsigned short msg_qbytes; /* max number of bytes on queue */
26 __kernel_ipc_pid_t msg_lspid; /* pid of last msgsnd */
27 __kernel_ipc_pid_t msg_lrpid; /* last receive pid */
30 /* message buffer for msgsnd and msgrcv calls */
31 struct msgbuf {
32 long mtype; /* type of message */
33 char mtext[1]; /* message text */
36 /* buffer for msgctl calls IPC_INFO, MSG_INFO */
37 struct msginfo {
38 int msgpool;
39 int msgmap;
40 int msgmax;
41 int msgmnb;
42 int msgmni;
43 int msgssz;
44 int msgtql;
45 unsigned short msgseg;
48 #define MSGMNI 128 /* <= 32768 */ /* max # of msg queue identifiers */
49 #define MSGMAX 4056 /* <= 4056 (?)*/ /* max size of message (bytes) */
50 #define MSGMNB 16384 /* <= MAX_INT */ /* default max size of a message queue */
52 /* unused */
53 #define MSGPOOL (MSGMNI*MSGMNB/1024) /* size in kilobytes of message pool */
54 #define MSGTQL MSGMNB /* number of system message headers */
55 #define MSGMAP MSGMNB /* number of entries in message map */
56 #define MSGSSZ 16 /* message segment size */
57 #define __MSGSEG ((MSGPOOL*1024)/ MSGSSZ) /* max no. of segments */
58 #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
60 #ifdef __KERNEL__
62 asmlinkage long sys_msgget (key_t key, int msgflg);
63 asmlinkage long sys_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg);
64 asmlinkage long sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz, long msgtyp, int msgflg);
65 asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds *buf);
67 #endif /* __KERNEL__ */
69 #endif /* _LINUX_MSG_H */