1 #ifndef _UAPI_LINUX_MSG_H
2 #define _UAPI_LINUX_MSG_H
6 /* ipcs ctl commands */
11 #define MSG_NOERROR 010000 /* no error if message is too big */
12 #define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
13 #define MSG_COPY 040000 /* copy (not remove) all queue messages */
15 /* Obsolete, used only for backwards compatibility and libc5 compiles */
17 struct ipc_perm msg_perm
;
18 struct msg
*msg_first
; /* first message on queue,unused */
19 struct msg
*msg_last
; /* last message in queue,unused */
20 __kernel_time_t msg_stime
; /* last msgsnd time */
21 __kernel_time_t msg_rtime
; /* last msgrcv time */
22 __kernel_time_t msg_ctime
; /* last change time */
23 unsigned long msg_lcbytes
; /* Reuse junk fields for 32 bit */
24 unsigned long msg_lqbytes
; /* ditto */
25 unsigned short msg_cbytes
; /* current number of bytes on queue */
26 unsigned short msg_qnum
; /* number of messages in queue */
27 unsigned short msg_qbytes
; /* max number of bytes on queue */
28 __kernel_ipc_pid_t msg_lspid
; /* pid of last msgsnd */
29 __kernel_ipc_pid_t msg_lrpid
; /* last receive pid */
32 /* Include the definition of msqid64_ds */
33 #include <asm/msgbuf.h>
35 /* message buffer for msgsnd and msgrcv calls */
37 long mtype
; /* type of message */
38 char mtext
[1]; /* message text */
41 /* buffer for msgctl calls IPC_INFO, MSG_INFO */
50 unsigned short msgseg
;
54 * Scaling factor to compute msgmni:
55 * the memory dedicated to msg queues (msgmni * msgmnb) should occupy
56 * at most 1/MSG_MEM_SCALE of the lowmem (see the formula in ipc/msg.c):
57 * up to 8MB : msgmni = 16 (MSGMNI)
59 * more than 16 GB : msgmni = 32K (IPCMNI)
61 #define MSG_MEM_SCALE 32
63 #define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
64 #define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
65 #define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
68 #define MSGPOOL (MSGMNI * MSGMNB / 1024) /* size in kbytes of message pool */
69 #define MSGTQL MSGMNB /* number of system message headers */
70 #define MSGMAP MSGMNB /* number of entries in message map */
71 #define MSGSSZ 16 /* message segment size */
72 #define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */
73 #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
76 #endif /* _UAPI_LINUX_MSG_H */