1 .\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
24 .\" Modified Sun Feb 18 01:59:29 2001 by Andries E. Brouwer <aeb@cwi.nl>
25 .\" Modified, 27 May 2004, Michael Kerrisk <mtk-manpages@gmx.net>
26 .\" Added notes on CAP_IPC_OWNER requirement
27 .\" Modified, 17 Jun 2004, Michael Kerrisk <mtk-manpages@gmx.net>
28 .\" Added notes on CAP_SYS_ADMIN requirement for IPC_SET and IPC_RMID
30 .TH MSGCTL 2 2004-06-17 "Linux 2.6.7" "Linux Programmer's Manual"
32 msgctl \- message control operations
36 #include <sys/types.h>
43 .BI "int msgctl(int " msqid ,
45 .BI "struct msqid_ds *" buf );
47 This function performs the control operation specified by
49 on the message queue with identifier
56 Copy info from the message queue data structure associated with
58 into the structure pointed to by
60 The caller must have read permission on the message queue.
63 Write the values of some members of the
65 structure pointed to by
67 to the message queue data structure, updating also its
70 The following members of the structure can be updated:
76 msg_perm.mode \fR/* only lowest 9-bits */\fP
81 The calling process must have appropriate (probably, root) privileges
82 or its effective user\-ID must be that of the creator
87 Appropriate privilege (Linux: the
89 capability) is required to raise the
91 value beyond the system parameter
95 Immediately remove the message queue and its associated data structure,
96 awakening all waiting reader and writer processes (with an error
101 The calling process must have appropriate (probably, root) privileges
102 or its effective user\-ID must be either that of the creator or owner
103 of the message queue.
105 On success, the return value will be
111 indicating the error.
115 is set to one of the following:
124 but the calling process does not have read permission on the message queue
126 and does not have the
137 but the address pointed to by
142 The message queue was removed.
157 but the effective user ID of the calling process is not the creator
163 of the message queue,
164 and the process is not privileged (Linux: it does not have the
168 Various fields in a \fIstruct msqid_ds\fP were shorts under Linux 2.2
169 and have become longs under Linux 2.4. To take advantage of this,
170 a recompilation under glibc-2.1.91 or later should suffice.
171 (The kernel distinguishes old and new calls by a IPC_64 flag in
174 SVr4, SVID. SVID does not document the EIDRM error condition.