]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/mq_open.3
getaddrinfo.3: Fix off-by-one error in example client program
[thirdparty/man-pages.git] / man3 / mq_open.3
index 55292c6039fa918ac800ccbd3b54282e0e50adb6..53519ab5bc0710efa033ec5a6f64705e50805849 100644 (file)
@@ -23,7 +23,7 @@
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" %%%LICENSE_END
 .\"
-.TH MQ_OPEN 3 2015-07-23 "Linux" "Linux Programmer's Manual"
+.TH MQ_OPEN 3 2017-09-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 mq_open \- open a message queue
 .SH SYNOPSIS
@@ -31,12 +31,12 @@ mq_open \- open a message queue
 .BR "#include <fcntl.h>" "           /* For O_* constants */"
 .BR "#include <sys/stat.h>" "        /* For mode constants */"
 .B #include <mqueue.h>
-.sp
+.PP
 .BI "mqd_t mq_open(const char *" name ", int " oflag );
 .BI "mqd_t mq_open(const char *" name ", int " oflag ", mode_t " mode ,
 .BI "              struct mq_attr *" attr );
 .fi
-.sp
+.PP
 Link with \fI\-lrt\fP.
 .SH DESCRIPTION
 .BR mq_open ()
@@ -47,7 +47,7 @@ For details of the construction of
 .IR name ,
 see
 .BR mq_overview (7).
-
+.PP
 The
 .I oflag
 argument specifies flags that control the operation of the call.
@@ -117,13 +117,36 @@ as for
 (Symbolic definitions for the permissions bits can be obtained by including
 .IR <sys/stat.h> .)
 The permissions settings are masked against the process umask.
-
-The
+.PP
+The fields of the
+.IR "struct mq_attr"
+pointed to
 .I attr
-argument specifies attributes for the queue.
-See
-.BR mq_getattr (3)
-for details.
+specify the maximum number of messages and
+the maximum size of messages that the queue will allow.
+This structure is defined as follows:
+.PP
+.PP
+.in +4n
+.EX
+struct mq_attr {
+    long mq_flags;       /* Flags (ignored for mq_open()) */
+    long mq_maxmsg;      /* Max. # of messages on queue */
+    long mq_msgsize;     /* Max. message size (bytes) */
+    long mq_curmsgs;     /* # of messages currently in queue
+                            (ignored for mq_open()) */
+};
+.EE
+.in
+.PP
+Only the
+.I mq_maxmsg
+and
+.I mq_msgsize
+fields are employed when calling
+.BR mq_open ();
+the values in the remaining fields are ignored.
+.PP
 If
 .I attr
 is NULL, then the queue is created with implementation-defined
@@ -207,16 +230,20 @@ limit.
 for details of these limits.)
 .TP
 .B EMFILE
-The process already has the maximum number of files and
-message queues open.
+The per-process limit on the number of open file
+and message queue descriptors has been reached
+(see the description of
+.BR RLIMIT_NOFILE
+in
+.BR getrlimit (2)).
 .TP
 .B ENAMETOOLONG
 .I name
 was too long.
 .TP
 .B ENFILE
-The system limit on the total number of open files and message queues
-has been reached.
+The system-wide limit on the total number of open files
+and message queues has been reached.
 .TP
 .B ENOENT
 The