blob: 0a7eefeee0d11862d7e2932a1ee56750b562b24f [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX_MSG_H
3#define _LINUX_MSG_H
4
David Woodhouse77597ad2006-04-25 14:26:46 +01005#include <linux/list.h>
Deepa Dinamani50578ea2017-08-02 19:51:12 -07006#include <linux/time64.h>
David Howells607ca462012-10-13 10:46:48 +01007#include <uapi/linux/msg.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9/* one msg_msg structure for each message */
10struct msg_msg {
Mathias Krause4e9b45a2013-11-12 15:11:47 -080011 struct list_head m_list;
12 long m_type;
13 size_t m_ts; /* message text size */
Manfred Spraul239521f2014-01-27 17:07:04 -080014 struct msg_msgseg *next;
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 void *security;
16 /* the actual message follows immediately */
17};
18
19/* one msq_queue structure for each present queue on the system */
20struct msg_queue {
21 struct kern_ipc_perm q_perm;
Deepa Dinamani50578ea2017-08-02 19:51:12 -070022 time64_t q_stime; /* last msgsnd time */
23 time64_t q_rtime; /* last msgrcv time */
24 time64_t q_ctime; /* last change time */
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 unsigned long q_cbytes; /* current number of bytes on queue */
26 unsigned long q_qnum; /* number of messages in queue */
27 unsigned long q_qbytes; /* max number of bytes on queue */
28 pid_t q_lspid; /* pid of last msgsnd */
29 pid_t q_lrpid; /* last receive pid */
30
31 struct list_head q_messages;
32 struct list_head q_receivers;
33 struct list_head q_senders;
Kees Cook3859a272016-10-28 01:22:25 -070034} __randomize_layout;
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#endif /* _LINUX_MSG_H */