.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond .TH MSGCTL 2 "November 1, 1993" "Linux 0.99.13" "Linux Programmer's Manual" .SH NAME msgctl \- message control operations .SH SYNOPSIS .nf .B # include .B # include .B # include .fi .sp .BI "int msgctl ( int " msqid ", .BI "int " cmd , .BI "struct msqid_ds *" buf " )" .SH DESCRIPTION The function performs the control operation specified by .I cmd on the message queue with identifier .IR msqid . Legal values for .I cmd are: .TP 12 .B IPC_STAT Copy info from the message queue data structure into the structure pointed to by .IR buf . The user must have read access privileges on the message queue. .TP .B IPC_SET Write the values of some members of the .B msqid_ds structure pointed to by .I buf to the message queue data structure, updating also its .B msg_ctime member. Considered members from the user supplied .B "struct msqid_ds" pointed to by .I buf are .nf .sp .ft B msg_perm.uid msg_perm.gid msg_perm.mode \fR/* only lowest 9-bits */\fP msg_qbytes .fi .ft R .sp The calling process effective user\-ID must be one among super\-user, creator or owner of the message queue. Only the super\-user can raise the .B msg_qbytes value beyond the system parameter .BR MSGMNB . .TP .B IPC_RMID Remove immediately the message queue and its data structures awakening all waiting reader and writer processes (with an error return and .B errno set to .BR EIDRM ). The calling process effective user\-ID must be one among super\-user, creator or owner of the message queue. .SH "RETURN VALUE" If successful, the return value will be .BR 0 , otherwise .B \-1 with .B errno indicating the error. .SH ERRORS For a failing return, .B errno will be set to one among the following values: .TP 11 .B EACCES The argument .I cmd is equal to .B IPC_STAT but the calling process has no read access permissions on the message queue .IR msqid . .TP .B EFAULT The argument .I cmd has value .B IPC_SET or .B IPC_STAT but the address pointed to by .I buf isn't accessible. .TP .B EIDRM The message queue was removed. .TP .B EINVAL Invalid value for .I cmd or .IR msqid . .TP .B EPERM The argument .I cmd has value .B IPC_SET or .B IPC_RMID but the calling process effective user\-ID has insufficient privileges to execute the command. Note this is also the case of a non super\-user process trying to increase the .B msg_qbytes value beyond the value specified by the system parameter .BR MSGMNB . .SH NOTES The .BR IPC_INFO , .BR MSG_STAT and .B MSG_INFO control calls are used by the .BR ipcs (8) program to provide information on allocated resources. In the future these can be modified as needed or moved to a proc file system interface. .SH "CONFORMING TO" SVr4, SVID. SVID dies not document the EIDRM error condition. .SH "SEE ALSO" .BR ipc (5), .BR msgget (2), .BR msgsnd (2), .BR msgrcv (2).