1570af302Sopenharmony_ci#ifndef _SYS_MSG_H
2570af302Sopenharmony_ci#define _SYS_MSG_H
3570af302Sopenharmony_ci
4570af302Sopenharmony_ci#ifdef __cplusplus
5570af302Sopenharmony_ciextern "C" {
6570af302Sopenharmony_ci#endif
7570af302Sopenharmony_ci
8570af302Sopenharmony_ci#include <sys/ipc.h>
9570af302Sopenharmony_ci
10570af302Sopenharmony_ci#define __NEED_pid_t
11570af302Sopenharmony_ci#define __NEED_key_t
12570af302Sopenharmony_ci#define __NEED_time_t
13570af302Sopenharmony_ci#define __NEED_size_t
14570af302Sopenharmony_ci#define __NEED_ssize_t
15570af302Sopenharmony_ci
16570af302Sopenharmony_ci#include <bits/alltypes.h>
17570af302Sopenharmony_ci
18570af302Sopenharmony_citypedef unsigned long msgqnum_t;
19570af302Sopenharmony_citypedef unsigned long msglen_t;
20570af302Sopenharmony_ci
21570af302Sopenharmony_ci#include <bits/msg.h>
22570af302Sopenharmony_ci
23570af302Sopenharmony_ci#define __msg_cbytes msg_cbytes
24570af302Sopenharmony_ci
25570af302Sopenharmony_ci#define MSG_NOERROR 010000
26570af302Sopenharmony_ci#define MSG_EXCEPT  020000
27570af302Sopenharmony_ci
28570af302Sopenharmony_ci#define MSG_STAT (11 | (IPC_STAT & 0x100))
29570af302Sopenharmony_ci#define MSG_INFO 12
30570af302Sopenharmony_ci#define MSG_STAT_ANY (13 | (IPC_STAT & 0x100))
31570af302Sopenharmony_ci
32570af302Sopenharmony_cistruct msginfo {
33570af302Sopenharmony_ci	int msgpool, msgmap, msgmax, msgmnb, msgmni, msgssz, msgtql;
34570af302Sopenharmony_ci	unsigned short msgseg;
35570af302Sopenharmony_ci};
36570af302Sopenharmony_ci
37570af302Sopenharmony_ciint msgctl (int, int, struct msqid_ds *);
38570af302Sopenharmony_ciint msgget (key_t, int);
39570af302Sopenharmony_cissize_t msgrcv (int, void *, size_t, long, int);
40570af302Sopenharmony_ciint msgsnd (int, const void *, size_t, int);
41570af302Sopenharmony_ci
42570af302Sopenharmony_ci#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
43570af302Sopenharmony_cistruct msgbuf {
44570af302Sopenharmony_ci	long mtype;
45570af302Sopenharmony_ci	char mtext[1];
46570af302Sopenharmony_ci};
47570af302Sopenharmony_ci#endif
48570af302Sopenharmony_ci
49570af302Sopenharmony_ci#ifdef __cplusplus
50570af302Sopenharmony_ci}
51570af302Sopenharmony_ci#endif
52570af302Sopenharmony_ci
53570af302Sopenharmony_ci#endif
54