]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysvipc/sys/msg.h
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysvipc / sys / msg.h
CommitLineData
04277e02 1/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
7e3be507 2 This file is part of the GNU C Library.
60478656 3
7e3be507 4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
60478656 8
7e3be507
UD
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12 Lesser General Public License for more details.
60478656 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6 15 License along with the GNU C Library; if not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
60478656
RM
17
18#ifndef _SYS_MSG_H
19#define _SYS_MSG_H
20
21#include <features.h>
60478656 22
50e16f85
UD
23#define __need_size_t
24#include <stddef.h>
25
60478656
RM
26/* Get common definition of System V style IPC. */
27#include <sys/ipc.h>
28
29/* Get system dependent definition of `struct msqid_ds' and more. */
5107cf1d 30#include <bits/msq.h>
60478656 31
bba09d23 32/* Define types required by the standard. */
05b68e14 33#include <bits/types/time_t.h>
bba09d23
UD
34
35#ifndef __pid_t_defined
36typedef __pid_t pid_t;
37# define __pid_t_defined
38#endif
39
40#ifndef __ssize_t_defined
41typedef __ssize_t ssize_t;
42# define __ssize_t_defined
43#endif
44
60478656
RM
45/* The following System V style IPC functions implement a message queue
46 system. The definition is found in XPG2. */
47
bba09d23 48#ifdef __USE_GNU
60478656
RM
49/* Template for struct to be used as argument for `msgsnd' and `msgrcv'. */
50struct msgbuf
f4017d20 51 {
180be88b 52 __syscall_slong_t mtype; /* type of received/sent message */
f4017d20
UD
53 char mtext[1]; /* text of the message */
54 };
bba09d23 55#endif
60478656
RM
56
57
f4017d20
UD
58__BEGIN_DECLS
59
60478656 60/* Message queue control operation. */
c1422e5b 61extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW;
60478656
RM
62
63/* Get messages queue. */
c1422e5b 64extern int msgget (key_t __key, int __msgflg) __THROW;
60478656 65
2c008571
UD
66/* Receive message from message queue.
67
68 This function is a cancellation point and therefore not marked with
69 __THROW. */
a5852807
UD
70extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz,
71 long int __msgtyp, int __msgflg);
2c008571
UD
72
73/* Send message to message queue.
60478656 74
2c008571
UD
75 This function is a cancellation point and therefore not marked with
76 __THROW. */
a784e502 77extern int msgsnd (int __msqid, const void *__msgp, size_t __msgsz,
2c008571 78 int __msgflg);
60478656
RM
79
80__END_DECLS
81
82#endif /* sys/msg.h */