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

System Functions (k - m) msgsnd(2)
The process catches a signal. In this case, the message is not sent and the process
resumes execution as directed by a sigaction() function call.
If the msgsnd( ) function nishes successfully, the system updates the msqid_ds structure associ-
ated with the msqid parameter. Specically, it does the following:
Increments the value in the msg_qnum eld by 1.
Increments the value in the msg_cbytes eld by the message text size.
Sets the msg_lspid eld to the OSS process ID of the calling process.
Sets the msg_stime eld to the current time.
Message Queue Use Between Environments
Guardian processes cannot use OSS functions to access OSS message queues. If called from a
Guardian process, the function call fails and errno is set to [ENOTOSS].
NOTES
The IPC_NOWAIT ag is dened in the sys/ipc.h header le.
The user-supplied msgbuf structure can be dened as follows:
struct msgbuf {
long int mtype;
char mtext[];
};
The mtype eld is a user-chosen positive integer that represents the message type. A receiving
process can use the message type to select only those messages it wants to receive from the
queue. (See the msgrcv(2) reference page.)
The mtext eld contains any text of the length specied by the msgsz parameter.
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 msgsnd( ) function sets errno to the value that
corresponds to the condition.
[EACCES] The calling process does not have the correct access permission for the opera-
tion.
[EAGAIN] The IPC_NOWAIT ag is used in the msgg parameter, and either the max-
imum number of message headers has been allocated or the size of the message
exceeds the amount of space currently available on the target queue.
[EFAULT] The msqid_ds structure associated with the message queue identier cannot be
found.
[EIDRM] The message queue identied by the msqid parameter has been removed from
the system.
[EINTR] The operation was interrupted by a signal.
527186-003 Hewlett-Packard Company 443