Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (k - m) msgsnd(2)
64-bit process sends a msgbuf structure that contain a 64-bit mtype field to a 32-bit process. The
32-bit process that receives the structure does not understand how to process the message
because it expects this field to be only 32 bits long. Additionally, although the mtext field starts
at the 65th bit of the message, the 32-bit process expects the mtype field to start at the 33rd bit of
the message.
To allow interoperability between 64-bit and 32-bit processes, it is recommended that 64-bit
applications define their msgbuf structure as follows:
struct msgbuf {
int mtype;
char mtext[ ];
};
and that all 64-bit callers use the MSG_32BIT_MTYPE ag in the msgflg parameter for all calls
to msgrcv() and msgsnd().
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 flag is used in the msgflg 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 identifier cannot be
found.
[EIDRM] The message queue identified by the msqid parameter has been removed from
the system.
[EINTR] The operation was interrupted by a signal.
[EINVAL] One of the following conditions is true:
The msqid parameter does not specify a valid message queue identifier.
The value of the mtype field is less than 1.
The value of the msgsz parameter is less than 0 (zero) or greater than the
value defined by the MAXMSG value in SCF.
All processes for the relevant message server have failed.
Both MSG_32BIT_MTYPE and MSG_64BIT_MTYPE are specified
in the msgflag parameter.
[EMSGQNOTRUNNING]
The message queue server associated with the message queue identifier is not
running.
527186-023 Hewlett-Packard Company 471