xref: /linux/include/uapi/asm-generic/msgbuf.h (revision c95baf12f5077419db01313ab61c2aac007d40cd)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28a1ab315SDavid Howells #ifndef __ASM_GENERIC_MSGBUF_H
38a1ab315SDavid Howells #define __ASM_GENERIC_MSGBUF_H
48a1ab315SDavid Howells 
58a1ab315SDavid Howells #include <asm/bitsperlong.h>
6*9ef0e004SMasahiro Yamada #include <asm/ipcbuf.h>
7*9ef0e004SMasahiro Yamada 
88a1ab315SDavid Howells /*
98a1ab315SDavid Howells  * generic msqid64_ds structure.
108a1ab315SDavid Howells  *
118a1ab315SDavid Howells  * Note extra padding because this structure is passed back and forth
128a1ab315SDavid Howells  * between kernel and user space.
138a1ab315SDavid Howells  *
148a1ab315SDavid Howells  * msqid64_ds was originally meant to be architecture specific, but
158a1ab315SDavid Howells  * everyone just ended up making identical copies without specific
168a1ab315SDavid Howells  * optimizations, so we may just as well all use the same one.
178a1ab315SDavid Howells  *
18caf5e32dSArnd Bergmann  * 64 bit architectures use a 64-bit long time field here, while
19caf5e32dSArnd Bergmann  * 32 bit architectures have a pair of unsigned long values.
20caf5e32dSArnd Bergmann  * On big-endian systems, the lower half is in the wrong place.
218a1ab315SDavid Howells  *
228a1ab315SDavid Howells  * Pad space is left for:
238a1ab315SDavid Howells  * - 2 miscellaneous 32-bit values
248a1ab315SDavid Howells  */
258a1ab315SDavid Howells 
268a1ab315SDavid Howells struct msqid64_ds {
278a1ab315SDavid Howells 	struct ipc64_perm msg_perm;
28f991f015SArnd Bergmann #if __BITS_PER_LONG == 64
29caf5e32dSArnd Bergmann 	long		 msg_stime;	/* last msgsnd time */
30caf5e32dSArnd Bergmann 	long		 msg_rtime;	/* last msgrcv time */
31caf5e32dSArnd Bergmann 	long		 msg_ctime;	/* last change time */
32f991f015SArnd Bergmann #else
33f991f015SArnd Bergmann 	unsigned long	msg_stime;	/* last msgsnd time */
34f991f015SArnd Bergmann 	unsigned long	msg_stime_high;
35f991f015SArnd Bergmann 	unsigned long	msg_rtime;	/* last msgrcv time */
36f991f015SArnd Bergmann 	unsigned long	msg_rtime_high;
37f991f015SArnd Bergmann 	unsigned long	msg_ctime;	/* last change time */
38f991f015SArnd Bergmann 	unsigned long	msg_ctime_high;
398a1ab315SDavid Howells #endif
40f991f015SArnd Bergmann 	unsigned long	msg_cbytes;	/* current number of bytes on queue */
41f991f015SArnd Bergmann 	unsigned long	msg_qnum;	/* number of messages in queue */
42f991f015SArnd Bergmann 	unsigned long	 msg_qbytes;	/* max number of bytes on queue */
438a1ab315SDavid Howells 	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
448a1ab315SDavid Howells 	__kernel_pid_t msg_lrpid;	/* last receive pid */
45f991f015SArnd Bergmann 	unsigned long	 __unused4;
46f991f015SArnd Bergmann 	unsigned long	 __unused5;
478a1ab315SDavid Howells };
488a1ab315SDavid Howells 
498a1ab315SDavid Howells #endif /* __ASM_GENERIC_MSGBUF_H */
50