Update copyright notices with scripts/update-copyrights.
[glibc.git] / sysdeps / unix / sysv / linux / i386 / msgctl.c
blob37cfcb6fce66bf00340b8465baede29ad69b630c
1 /* Copyright (C) 1995-2013 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
5 The GNU C Library is free software; you can redistribute it and/or
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.
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
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #include <errno.h>
20 #include <sys/msg.h>
21 #include <ipc_priv.h>
23 #include <sysdep.h>
24 #include <string.h>
25 #include <sys/syscall.h>
26 #include <bp-checks.h>
28 #include <shlib-compat.h>
30 struct __old_msqid_ds
32 struct __old_ipc_perm msg_perm; /* structure describing operation permission */
33 struct msg *__unbounded __msg_first; /* pointer to first message on queue */
34 struct msg *__unbounded __msg_last; /* pointer to last message on queue */
35 __time_t msg_stime; /* time of last msgsnd command */
36 __time_t msg_rtime; /* time of last msgrcv command */
37 __time_t msg_ctime; /* time of last change */
38 struct wait_queue *__unbounded __wwait; /* ??? */
39 struct wait_queue *__unbounded __rwait; /* ??? */
40 unsigned short int __msg_cbytes; /* current number of bytes on queue */
41 unsigned short int msg_qnum; /* number of messages currently on queue */
42 unsigned short int msg_qbytes; /* max number of bytes allowed on queue */
43 __ipc_pid_t msg_lspid; /* pid of last msgsnd() */
44 __ipc_pid_t msg_lrpid; /* pid of last msgrcv() */
47 /* Allows to control internal state and destruction of message queue
48 objects. */
49 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
50 int __old_msgctl (int, int, struct __old_msqid_ds *);
51 #endif
52 int __new_msgctl (int, int, struct msqid_ds *);
54 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
55 int
56 attribute_compat_text_section
57 __old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf)
59 return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
60 msqid, cmd, 0, CHECK_1 (buf));
62 compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
63 #endif
65 int
66 __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
68 return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
69 msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
72 versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2);