Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (k - m) msgsnd(2)
NAME
msgsnd - Sends a message to a message queue
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosskdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosskdll
SYNOPSIS
#include <sys/msg.h>
int msgsnd(
int msqid,
const void *msgp,
size_t msgsz,
int msgflg);
PARAMETERS
msqid Specifies the identifier of the message queue in which to place the message. The
identifier is typically returned by a previous call to the msgget() function.
msgp Specifies a pointer to the msgbuf structure that contains the message. (See the
NOTES section.)
msgsz Specifies the size of the data array in the msgbuf structure.
msgflg Specifies the following actions:
• The action that the system should take if either or both of the following
are true (the system runs out of internal buffer space):
— 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-defined limit.
• Whether the msgp parameter is formatted for 32-bit and 64-bit interoper-
ability. (See the NOTES section for detailed information on how to use
the MSG_32BIT_MTYPE flag and msgbuf structure to allow 32-bit
and 64-bit processes to communicate using one msgbuf structure.)
DESCRIPTION
The msgsnd( ) function sends a message to the queue associated with the msqid parameter.
The msgp parameter points to a user-defined msgbuf structure. The structure identifies the mes-
sage type and contains a data array with the message text.
The size of the data array is specified by the msgsz parameter. The msgsz value can be from 0
(zero) through a system-defined maximum.
The msgflg parameter specifies actions that the system should take:
• If the IPC_NOWAIT flag is used in the msgflg parameter and the system runs out of
internal buffer space, the system does not send the message and returns to the calling
process immediately.
527186-023 Hewlett-Packard Company 4−69