]>
Commit | Line | Data |
---|---|---|
d4697bc9 | 1 | /* Copyright (C) 1995-2014 Free Software Foundation, Inc. |
cd090f71 UD |
2 | This file is part of the GNU C Library. |
3 | Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995. | |
4 | ||
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. | |
cd090f71 UD |
9 | |
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. |
cd090f71 | 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/>. */ | |
cd090f71 UD |
18 | |
19 | #include <errno.h> | |
20 | #include <sys/msg.h> | |
21 | #include <ipc_priv.h> | |
22 | ||
23 | #include <sysdep.h> | |
24 | #include <string.h> | |
25 | #include <sys/syscall.h> | |
26 | ||
b5567b2a | 27 | #include <shlib-compat.h> |
cd090f71 UD |
28 | |
29 | struct __old_msqid_ds | |
30 | { | |
31 | struct __old_ipc_perm msg_perm; /* structure describing operation permission */ | |
70d9946a JM |
32 | struct msg *__msg_first; /* pointer to first message on queue */ |
33 | struct msg *__msg_last; /* pointer to last message on queue */ | |
cd090f71 UD |
34 | __time_t msg_stime; /* time of last msgsnd command */ |
35 | __time_t msg_rtime; /* time of last msgrcv command */ | |
36 | __time_t msg_ctime; /* time of last change */ | |
70d9946a JM |
37 | struct wait_queue *__wwait; /* ??? */ |
38 | struct wait_queue *__rwait; /* ??? */ | |
cd090f71 UD |
39 | unsigned short int __msg_cbytes; /* current number of bytes on queue */ |
40 | unsigned short int msg_qnum; /* number of messages currently on queue */ | |
41 | unsigned short int msg_qbytes; /* max number of bytes allowed on queue */ | |
42 | __ipc_pid_t msg_lspid; /* pid of last msgsnd() */ | |
43 | __ipc_pid_t msg_lrpid; /* pid of last msgrcv() */ | |
44 | }; | |
45 | ||
46 | /* Allows to control internal state and destruction of message queue | |
47 | objects. */ | |
b5567b2a | 48 | #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) |
cd090f71 | 49 | int __old_msgctl (int, int, struct __old_msqid_ds *); |
b5567b2a | 50 | #endif |
cd090f71 UD |
51 | int __new_msgctl (int, int, struct msqid_ds *); |
52 | ||
b5567b2a | 53 | #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) |
cd090f71 | 54 | int |
4a381a81 | 55 | attribute_compat_text_section |
cd090f71 UD |
56 | __old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf) |
57 | { | |
f3aae3f3 | 58 | return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, buf); |
cd090f71 | 59 | } |
b5567b2a UD |
60 | compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0); |
61 | #endif | |
cd090f71 UD |
62 | |
63 | int | |
64 | __new_msgctl (int msqid, int cmd, struct msqid_ds *buf) | |
65 | { | |
d25c879d | 66 | return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, |
f3aae3f3 | 67 | msqid, cmd | __IPC_64, 0, buf); |
cd090f71 UD |
68 | } |
69 | ||
b5567b2a | 70 | versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2); |