Open System Services System Calls Reference Manual (G06.25+, H06.03+)
msgctl(2) OSS System Calls Reference Manual
IPC_STAT Queries the message queue identifier by copying the contents of
its associated msqid_ds data structure into the structure
specified by the buf parameter.
buf Specifies the address of a msqid_ds structure. This structure is used only with
the IPC_STAT and IPC_SET values of the cmd parameter. With IPC_STAT,
the results of the query are copied to this structure. With IPC_SET, the values in
this structure are used to set certain fields in the msqid_ds structure associated
with the message queue identifier. In either case, the calling process must have
allocated the structure before making the call.
DESCRIPTION
The msgctl() function allows a process to query or set the contents of the msqid_ds structure
associated with the specified message queue identifier. It also allows a process to remove the
message queue identifier and its associated msqid_ds structure. The value of the cmd parameter
determines which operation is performed.
The IPC_SET value of the cmd parameter uses the user-supplied contents of the buf parameter
to set the corresponding fields of the msqid_ds structure associated with the message queue
identifier:
• The owner’s user ID field (msg_perm.uid) is set as specified in the input.
• The owner’s group ID field (msg_perm.gid) is set as specified in the input.
• The access modes field (msg_perm.mode) is set as specified in the low-order nine bits
of the corresponding field in the input.
• The maximum number of bytes field (msg_qbytes) for the queue is set as specified in the
input.
• The field for the time of the last msgctl() operation that changed the structure
(msg_ctime) is set as specified in the input.
Message Queue Use Between Environments
Guardian processes cannot use OSS functions for access to OSS message queues. If called from
a Guardian process, this function fails and errno is set to [ENOTOSS].
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned,
and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the msgctl() function sets errno to the value that
corresponds to the condition.
[EACCES] The cmd parameter is IPC_STAT, but the calling process does not have read
permission.
[EFAULT] The msqid_ds structure associated with the message queue identifier cannot be
found.
[EINVAL] One of the following conditions exists:
• The msqid parameter does not specify a valid message queue identifier.
• The cmd parameter is not a valid command.
4−34 Hewlett-Packard Company 527186-003