Open System Services System Calls Reference Manual (G06.25+, H06.03+)

msgctl(2) OSS System Calls Reference Manual
IPC_STAT Queries the message queue identier by copying the contents of
its associated msqid_ds data structure into the structure
specied by the buf parameter.
buf Species 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 elds in the msqid_ds structure associated
with the message queue identier. 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 specied message queue identier. It also allows a process to remove the
message queue identier 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 elds of the msqid_ds structure associated with the message queue
identier:
The owners user ID eld (msg_perm.uid) is set as specied in the input.
The owners group ID eld (msg_perm.gid) is set as specied in the input.
The access modes eld (msg_perm.mode) is set as specied in the low-order nine bits
of the corresponding eld in the input.
The maximum number of bytes eld (msg_qbytes) for the queue is set as specied in the
input.
The eld for the time of the last msgctl() operation that changed the structure
(msg_ctime) is set as specied 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 identier cannot be
found.
[EINVAL] One of the following conditions exists:
The msqid parameter does not specify a valid message queue identier.
The cmd parameter is not a valid command.
434 Hewlett-Packard Company 527186-003