SYNOPSIS
#include <sys/msg.h>
int msgget(key_t key, int msgflg);
DESCRIPTION
The
When created, the data structure associated with the new message queue identifier is initialized in the following way:
- msg_perm.cuid, msg_perm.uid, msg_perm.cgid, and msg_perm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process.
- The permission bits of msg_perm.mode are set to the permission bits of msgflg.
- msg_qnum, msg_lspid, msg_lrpid, msg_stime, and msg_rtime are set to 0.
- msg_ctime is set to the current time.
- msg_qbytes is set to the system limit.
PARAMETERS
- key
-
Specifies the message queue key for which to retrieve the msqid.
- msgflg
-
Is a flag that indicates specific message queue conditions and options to implement.
RETURN VALUES
If successful,
- EACCES
-
A message queue identifier exists for key, but operation permission as specified by permission bits of msgflg would not be granted.
- EEXIST
-
A message queue identifier exists for key, but both (msgflg & IPC_CREAT) and (msgflg & IPC_EXCL) are both non-zero.
- ENOENT
-
A message queue identifier does not exist for key and (msgflg & IPC_CREAT) is zero.
- ENOSPC
-
A message queue identifier is to be created, but the system-imposed limit on the maximum number of allowed message queue identifiers system wide would be exceeded.
CONFORMANCE
Unix 98.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.