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

msgsnd(2) OSS System Calls Reference Manual
NAME
msgsnd - Sends a message to a message queue
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
H-series OSS processes: /G/system/zdllnnn/zosskdll
SYNOPSIS
#include <sys/msg.h>
int msgsnd(
int msqid,
const void *msgp,
size_t msgsz,
int msgg);
PARAMETERS
msqid Species the identier of the message queue in which to place the message. The
identier is typically returned by a previous call to the msgget() function.
msgp Species a pointer to the msgbuf structure that contains the message. (See the
NOTES section.)
msgsz Species the size of the data array in the msgbuf structure.
msgflg Species the action to be taken by the system if it runs out of internal buffer
space.
DESCRIPTION
The msgsnd() function sends a message to the queue associated with the msqid parameter.
The msgp parameter points to a user-dened msgbuf structure. The structure identies the mes-
sage type and contains a data array with the message text.
The size of the data array is specied by the msgsz parameter. The msgsz value can be from 0
(zero) through a system-dened maximum.
The msgg parameter species the action that the system should take if either or both of the fol-
lowing are true:
The current number of bytes in the message queue is equal to msg_qbytes (in the
msqid_ds structure).
The total number of messages in all message queues is equal to the system-dened limit.
Either of two system actions can be specied, as follows:
If the IPC_NOWAIT ag is used in the msgg parameter, the system does not send the
message and returns to the calling process immediately.
If the IPC_NOWAIT ag is not used in the msgg parameter, the system suspends the
calling process. The process remains suspended until one of the following occurs:
The blocking condition is removed. In this case, the system sends the message.
The specied message queue identier is removed from the system. In this case,
the system sets errno to [EIDRM] and returns the value -1 to the calling process.
442 Hewlett-Packard Company 527186-003