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