msgctl(PCI) 6 January 1993 msgctl(PCI) Name msgctl - message control operations Syntax #include <pcilib.h> #include <memmdl.h> #include <ipc.h> int msgctl (msqid, cmd, buf) int msqid, cmd; struct msqid_ds *buf; Description msgctl provides a variety of message control operations as specified by cmd. The operations are performed on the current host (as specified in the most recent dflthost call). The following cmds are available: IPCSTAT Place the current value of each member of the data structure associated with msqid into the structure pointed to by buf. The contents of this structure are defined in Intro(PCI). IPCSET Set the value of the following members of the data structure associated with msqid to the corresponding value found in the structure pointed to by buf: msg_perm.uid msg_perm.gid msg_perm.mode /* only low nine bits */ msg_qbytes This cmd can only be executed by a process with an effective user ID equal to either the super-user or the value of msgperm.[c]uid in the data structure associated with msqid. Only the super-user can raise the value of msgqbytes. IPCRMID Remove the message queue identifier specified by msqid from the UNIX operating system and destroy the message queue and data structure associated with it. This cmd can only be executed by a process that has an effective user ID equal to either that of super-user or to the value of msgperm.[c]uid in the data structure associated with msqid. msgctl fails if one or more of the following are true: [EINVAL] msqid is not a valid message queue identifier. [EINVAL] cmd is not a valid command. [EACCES] cmd is equal to IPCSTAT and read operation permission is denied to the calling process (see Intro(PCI). [EPERM] cmd is equal to IPCRMID or IPCSET, and the effective user ID of the calling process is not equal to that of super-user and is not equal to the value of msgperm.[c]uid in the data struc- ture associated with msqid. [EPERM] cmd is equal to IPCSET, an attempt is being made to increase to the value of msgqbytes, and the effective user ID of the calling process is not equal to that of super-user. [EFAULT] buf points to an illegal address. Return value On successful completion, a value of 0 returns. If the call fails for any reason, a value of -1 returns and errno is set to indicate the error. See also dflthost(PCI), Intro(PCI), msgget(PCI), msgrcv(PCI), msgsnd(PCI)