<assertions>
  <assertion id="1" tag="ref:XSH6:25736:25740 pt:MSG">
mq_open() returns a message queue descriptor that establishes a connection
between a process and a message queue.  That descriptor refers to the open
message queue description referring to the message queue created by mq_open().

The message queue descriptor returned by mq_open() can be used by other
functions to refer to the message queue created.

name is the message queue name (string).
Note:  It is not specified if this name actually appears as part of the
filesystem and/or if functions on files apply to the message queue.
  </assertion>
  <assertion id="2" tag="ref:XSH6:25740:25746 pt:MSG">
name must follow the correct construction rules for a pathname

- If the first letter of name is "/" then any other process calling the
  message queue with that name will refer to that message queue object (unless
  it's been removed).
- If the first letter of name is not "/" the behavior is implementation
  defined.
- How other "/"s in name are interpreted is implementation-defined.
  </assertion>
  <assertion id="3" tag="ref:XSH6:25747:25748 pt:MSG">
mq_open() returns an error if creation is not requested and name does
not refer to an already existing message queue
  </assertion>
  <assertion id="4" tag="ref:XSH6:25749:25750 pt:MSG">
If the message queue descriptor is implemented with a file descriptor, at
least {OPEN_MAX} file and message queues can be opened.
  </assertion>
  <assertion id="5" tag="ref:XSH6:25751:25753 pt:MSG">
oflag refers to the send/receive access to the message queue.  They behave
just as read/write, respectively, access on a file with equivalent
protections.
  </assertion>
  <assertion id="6" tag="ref:XSH6:25754:25755 ref:XSH6:25768:25768 pt:MSG">
oflag is a bitwise-inclusive OR of:
exactly ONE of O_RDONLY, O_WRONLY, O_RDWR (access modes)
any combination of O_CREAT, O_EXCL, O_NONBLOCK
  </assertion>
  <assertion id="7" tag="ref:XSH6:25756:25759 pt:MSG">
If the access mode is O_RDONLY, the message queue can receive messages, but
not send.  (i.e., the message queue descriptor returned can be used with
mq_receive, but not mq_send.)

A message queue can be opened more than once in either the same
process or a different process for receiving messages.
  </assertion>
  <assertion id="8" tag="ref:XSH6:25760:25763 pt:MSG">
If the access mode is O_WRONLY, the message queue can send messages, but
not receive.  (i.e., the message queue descriptor can be used with mq_send,
but not ms_receive)

A message queue can be opened more than once in either the same process or
a different process for sending messages.
  </assertion>
  <assertion id="9" tag="ref:XSH6:25764:25767 pt:MSG">
If the access mode is O_RDWR, the message queue can send or receive
messages (i.e., both mq_receive and mq_send can be used).

A message queue can be opened more than once in either the same process or
a different process for sending messages.
  </assertion>
  <assertion id="10" tag="ref:XSH6:25769:25778 pt:MSG">
If the O_CREAT flag is set, a message queue is created.

In addition, the arguments mode_t mode and mq_attr *attr should be sent.

If name has not been used to create a currently-existing message queue, then
an empty message queue will be created with a user ID == the effective user
ID of the process and group ID == effective group ID of the process.  The
file permissions == mode.  (It's undefined what happens if non-file
permissions bits are set in mode).
  </assertion>
  <assertion id="11" tag="ref:XSH6:25771:25773 pt:MSG">
If the O_CREAT flag is set and name has already been used to create a
currently existing message queue, then the current call has no effect
(except for exceptions noted with O_EXCL assertions).
  </assertion>
  <assertion id="12" tag="ref:XSH6:25779:25779 pt:MSG">
If the O_CREAT flag is set and attr == NULL, then the implementation-defined
default message queue attributes will be used.
  </assertion>
  <assertion id="13" tag="ref:XSH6:25780:25783 pt:MSG">
If the O_CREAT flag is set and attr != NULL, then, if the calling process
has the allowed privileges on name, mq_maxmsg and ms_msgsize will be set
as defined in attr.
  </assertion>
  <assertion id="14" tag="ref:XSH6:25783:25785 pt:MSG">
If the O_CREAT flag is set and attr != NULL, but the calling process does
not have the allowed privileges on name, mq_open() will fail and return
an error.  No message queue will have been created.
  </assertion>
  <assertion id="15" tag="ref:XSH6:25786:25786 pt:MSG">
If O_EXCL and O_CREAT are set, and message queue name already exists,
mq_open() fails.
  </assertion>
  <assertion id="16" tag="ref:XSH6:25787:25789 pt:MSG">
When O_EXCL and O_CREAT are set, this check to see if the message queue
exists and creation of the message queue (if it doesn't already exist)
are atomic w.r.t. other threads calling mq_open with O_EXCL and O_CREAT and
using the same name.
  </assertion>
  <assertion id="17" tag="ref:XSH6:25790:25791 pt:MSG">
If O_EXCL is set without O_CREAT set, the results are undefined.
  </assertion>
  <assertion id="18" tag="ref:XSH6:25792:25794 pt:MSG">
O_NONBLOCK determines the blocking/non-blocking behavior of the mq_send()
and mq_receive() calls.  Tests will be done in the mq_send() and mq_receive()
function tests.
  </assertion>
  <assertion id="19" tag="ref:XSH6:25795:25795 pt:MSG">
mq_open() does not add messages to the queue or remove messages from the
queue
  </assertion>
  <assertion id="20" tag="ref:XSH6:25797:25797 pt:MSG">
If mq_open() is successful, it will return a message queue descriptor.
  </assertion>
  <assertion id="21" tag="ref:XSH6:25798:25798 pt:MSG">
If mq_open() is not successful, it will return (mqd_t)-1 and set errno
to indicate the error.
  </assertion>
  <assertion id="22" tag="ref:XSH6:25801:25803 pt:MSG">
mq_open() fails with EACCES if either:
- the message queue exists, but the oflag permissions are denied
or
- the message queue doesn't exist, but permission to create it is denied
  </assertion>
  <assertion id="23" tag="ref:XSH6:25804:25804 pt:MSG">
mq_open() fails with EEXIST if O_CREAT and O_EXCL are set in the flags, but
the message queue exists already
  </assertion>
  <assertion id="24" tag="ref:XSH6:25805:25805 pt:MSG">
mq_open() fails with EINTR if it is interrupted by a signal
  </assertion>
  <assertion id="25" tag="ref:XSH6:25806:25808 pt:MSG">
mq_open() fails with EINVAL if either:
- mq_open() is not supported for the name parameter
- O_CREAT was set in oflag, attr != NULL, and either mq_maxmsq less than
  or equal to 0 or mq_msgsize less than or equal to 0
  </assertion>
  <assertion id="26" tag="ref:XSH6:25809:25810 pt:MSG">
mq_open() fails with EMFILE if there are too many message queue descriptors
or file descriptors in use by the process calling mq_open
  </assertion>
  <assertion id="27" tag="ref:XSH6:25811:25813 pt:MSG">
mq_open() fails with ENAMETOOLONG if the name parameter's length greater
than PATH_MAX or a component of the pathname in name greater than NAME_MAX
  </assertion>
  <assertion id="28" tag="ref:XSH6:25814:25814 pt:MSG">
mq_open() fails with ENFILE if the system has too many message queues open
at the time mq_open() is called
  </assertion>
  <assertion id="29" tag="ref:XSH6:25815:25815 pt:MSG">
mq_open() fails with ENOENT if the named message queue does not yet exist,
but O_CREAT is not set
  </assertion>
  <assertion id="30" tag="ref:XSH6:25816:25816 pt:MSG">
mq_open() fails with ENOSPC if there is not enough space to create the
message queue
  </assertion>
</assertions>
