

msgctl()               COHERENT System Call              msgctl()




Message control operations

#include <sys/msg.h>
iinntt mmssggccttll(_m_s_q_i_d, _c_m_d, _b_u_f)
iinntt _m_s_q_i_d; iinntt _c_m_d; ssttrruucctt mmssqqiidd_ddss *_b_u_f;

msgctl performs the  message-control operations specified by cmd.
The following cmds are available:

IIPPCC_SSTTAATT   Place the  current value  of each  member of  the data
          structure  associated  with  msqid into  the  structure
          pointed to by buf.

IIPPCC_SSEETT    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 9 bits */
          msg_qbytes

          This  cmd can only be executed by a process that has an
          effective-user identifier  equal to either  that of su-
          peruser  or to  the value of  msg_perm.uid in  the data
          structure  associated with  msqid.  Only  superuser can
          raise the value of msg_qbytes.

IIPPCC_RRMMIIDD  Remove  the system  identifier specified by  msqid from
          the  system  and destroy  the  message  queue and  data
          structure associated with it.  This cmd can only be ex-
          ecuted by  a process  that has an  effective-user iden-
          tifier  equal to  either that  of  superuser or  to the
          value of msg_perm.uid  in the data structure associated
          with msqid.

msgctl fails if any of the following are true:

*  msqid  is not a  valid message queue  identifier.  msgctl sets
   the global variable errno to EINVAL.

*  cmd is not a valid command (EEIINNVVAALL).

*  cmd is equal to IPC_STAT and operation permission is denied to
   the calling process (EEAACCCCEESS).

*  cmd  is equal to  IPC_RMID or IPC_SET,  and the effective-user
   identifier of the calling process  is not equal to that of su-
   peruser and  it is not  equal to the value  of msg_perm.uid in
   the data structure associated with msqid (EEPPEERRMM).

*  cmd is equal to IPC_SET,  an attempt is being made to increase
   to the value  of msg_qbytes, and the effective-user identifier
   of  the calling  process is  not equal to  that of  super user


COHERENT Lexicon                                           Page 1




msgctl()               COHERENT System Call              msgctl()



   (EEPPEERRMM).

*  buf points to an illegal address (EEFFAAUULLTT).

***** Return Value *****

Upon successful  completion, msgctl  returns zero.  If  a problem
occurs, it returns -1 and sets eerrrrnnoo to an appropriate value.

***** Files *****

/usr/include/sys/ipc.h
/usr/include/sys/msg.h
/dev/msg

***** See Also *****

COHERENT system calls, msg, msgget(), msgrcv(), msgsnd()

***** Notes *****

To improve portability,  COHERENT implements the mmssgg functions as
a device driver rather than as an actual system call.


































COHERENT Lexicon                                           Page 2


