mq_open.2 (2010 09)

m
mq_open(2) mq_open(2)
b. Contain no path name component consisting of a dot or dot-dot. For example,
/./tmp and
/../tmp are invalid.
c. Contain no illegal characters.
d. Contain no path name components longer that
_POSIX_NAME_MAX
.
e. Entire name should not be longer that
_POSIX_PATH_MAX
.
To use this function, link in the realtime library by specifying
-lrt on the compiler or linker command
line.
Security Restrictions
Some or all of the actions associated with this system call are subject to compartmental restrictions. See
compartments (5) for more information about compartmentalization on systems that support that feature.
Compartmental restrictions can be overridden if the process possesses the
COMMALLOWED privilege
(
PRIV_COMMALLOWED
). Processes owned by the superuser may not have this privilege. Processes
owned by any user may have this privilege, depending on system configuration.
Some or all of the actions associated with this system call require the
DACWRITE privilege
(
PRIV_DACWRITE
). Processes owned by the superuser have this privilege. Processes owned by other
users may have this privilege, depending on system configuration.
See privileges (5) for more information about privileged access on systems that support fine-grained
privileges.
RETURN VALUE
mq_open() returns the following values:
n Successful completion. n is a message queue descriptor for the opened message queue and is
greater than or equal to
0.
-1 Failure. errno is set to indicate the error.
ERRORS
If
mq_open() fails, errno is set to one of the following values:
[EACCES] The message queue exists and the permissions specified by oflag are denied, or the
message queue does not exist and permission to create the queue is denied.
[EEXIST] The
O_CREAT and O_EXCL flags are set in oflag and the named message queue
exists.
[EINTR]
mq_open() was interrupted by a signal.
[EINVAL] The argument name, does not conform to the Message Queue Naming Convention .
O_CREAT has been specified in oflag, the value of attr is not NULL, and either
mq_maxmsg or mq_msgsize is less than or equal to zero.
[EMFILE] Too many message queue descriptors are currently in use by this process.
[ENAMETOOLONG]
The length of the name string exceeds
PATH_MAX bytes, or the length of a (path
name) component of the name string exceeds NAME_MAX bytes while
_POSIX_NO_TRUNC is in effect.
[ENFILE] Too many message queues are currently open in the system.
[ENOENT] The
O_CREAT flag is not set in oflag and the named message queue does not exist.
[ENOSPC] There are insufficient resources for the creation of the new message queue.
[ENOSYS]
mq_open() is not supported by the implementation.
SEE ALSO
mq_close(2), mq_getattr(2), mq_receive(2), mq_send(2), mq_setattr(2), mq_unlink(2), privileges(5).
STANDARDS CONFORMANCE
mq_open(): POSIX 1003.1b
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010