blob: 3454b929d66a12105a1747708cabbfa7d460832f [file] [log] [blame]
Elliott Hughes13da6002025-02-03 10:42:13 -08001// Copyright (C) 2017 The Android Open Source Project
2// SPDX-License-Identifier: BSD-2-Clause
Elliott Hughes21b56eb2017-10-20 17:57:17 -07003
Christopher Ferrisa981e2e2018-10-25 12:11:39 -07004#if defined(__BIONIC__)
5
Elliott Hughes21b56eb2017-10-20 17:57:17 -07006#include <sys/msg.h>
7
8#include "header_checks.h"
9
10static void sys_msg_h() {
11 TYPE(msgqnum_t);
12 TYPE(msglen_t);
13
14 MACRO(MSG_NOERROR);
15
16 TYPE(struct msqid_ds);
17 STRUCT_MEMBER(struct msqid_ds, struct ipc_perm, msg_perm);
18 STRUCT_MEMBER(struct msqid_ds, msgqnum_t, msg_qnum);
19 STRUCT_MEMBER(struct msqid_ds, msglen_t, msg_qbytes);
20 STRUCT_MEMBER(struct msqid_ds, pid_t, msg_lspid);
21 STRUCT_MEMBER(struct msqid_ds, pid_t, msg_lrpid);
Christopher Ferrisa981e2e2018-10-25 12:11:39 -070022#if defined(__LP64__)
Elliott Hughes21b56eb2017-10-20 17:57:17 -070023 STRUCT_MEMBER(struct msqid_ds, time_t, msg_stime);
24 STRUCT_MEMBER(struct msqid_ds, time_t, msg_rtime);
25 STRUCT_MEMBER(struct msqid_ds, time_t, msg_ctime);
Christopher Ferrisa981e2e2018-10-25 12:11:39 -070026#else
27 // Starting at kernel v4.19, 32 bit changed these to unsigned values.
28 STRUCT_MEMBER(struct msqid_ds, unsigned long, msg_stime);
29 STRUCT_MEMBER(struct msqid_ds, unsigned long, msg_rtime);
30 STRUCT_MEMBER(struct msqid_ds, unsigned long, msg_ctime);
31#endif
Elliott Hughes21b56eb2017-10-20 17:57:17 -070032
33 TYPE(pid_t);
34 TYPE(size_t);
35 TYPE(ssize_t);
36 TYPE(time_t);
37
38 FUNCTION(msgctl, int (*f)(int, int, struct msqid_ds*));
39 FUNCTION(msgget, int (*f)(key_t, int));
40 FUNCTION(msgrcv, ssize_t (*f)(int, void*, size_t, long, int));
41 FUNCTION(msgsnd, int (*f)(int, const void*, size_t, int));
42}
Christopher Ferrisa981e2e2018-10-25 12:11:39 -070043#endif