]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man7/mq_overview.7
user_namespaces.7: Minor rewordings of recently added text
[thirdparty/man-pages.git] / man7 / mq_overview.7
index a1fbff343e56ba4af80e84fddc4a7fbbcc60b74f..d87d21f4c867c8e5cda4635ac0005ddfcc05cb17 100644 (file)
@@ -23,7 +23,7 @@
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" %%%LICENSE_END
 .\"
-.TH MQ_OVERVIEW 7 2015-08-08 "Linux" "Linux Programmer's Manual"
+.TH MQ_OVERVIEW 7 2017-09-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 mq_overview \- overview of POSIX message queues
 .SH DESCRIPTION
@@ -34,7 +34,7 @@ This API is distinct from that provided by System V message queues
 .BR msgsnd (2),
 .BR msgrcv (2),
 etc.), but provides similar functionality.
-
+.PP
 Message queues are created and opened using
 .BR mq_open (3);
 this function returns a
@@ -49,7 +49,7 @@ that is, a null-terminated string of up to
 followed by one or more characters, none of which are slashes.
 Two processes can operate on the same queue by passing the same name to
 .BR mq_open (3).
-
+.PP
 Messages are transferred to and from a queue using
 .BR mq_send (3)
 and
@@ -65,10 +65,10 @@ and
 A process can request asynchronous notification
 of the arrival of a message on a previously empty queue using
 .BR mq_notify (3).
-
+.PP
 A message queue descriptor is a reference to an
 .I "open message queue description"
-(cf.
+(see
 .BR open (2)).
 After a
 .BR fork (2),
@@ -78,7 +78,7 @@ as the corresponding message queue descriptors in the parent.
 Corresponding message queue descriptors in the two processes share the flags
 .RI ( mq_flags )
 that are associated with the open message queue description.
-
+.PP
 Each message has an associated
 .IR priority ,
 and messages are always delivered to the receiving process
@@ -184,7 +184,7 @@ limit is ignored for privileged processes
 but the
 .BR HARD_MSGMAX
 ceiling is nevertheless imposed.
-
+.IP
 The definition of
 .BR HARD_MSGMAX
 has changed across kernel versions:
@@ -285,33 +285,33 @@ On Linux, message queues are created in a virtual filesystem.
 but the details are likely to differ.)
 This filesystem can be mounted (by the superuser) using the following
 commands:
+.PP
 .in +4n
-.nf
-
+.EX
 .RB "#" " mkdir /dev/mqueue"
 .RB "#" " mount \-t mqueue none /dev/mqueue"
-
-.fi
+.EE
 .in
+.PP
 The sticky bit is automatically enabled on the mount directory.
-
+.PP
 After the filesystem has been mounted, the message queues on the system
 can be viewed and manipulated using the commands usually used for files
 (e.g.,
 .BR ls (1)
 and
 .BR rm (1)).
-
+.PP
 The contents of each file in the directory consist of a single line
 containing information about the queue:
+.PP
 .in +4n
-.nf
-
+.EX
 .RB "$" " cat /dev/mqueue/mymq"
 QSIZE:129     NOTIFY:2    SIGNO:0    NOTIFY_PID:8260
-
-.fi
+.EE
 .in
+.PP
 These fields are as follows:
 .TP
 .B QSIZE
@@ -336,14 +336,20 @@ and
 .B SIGNO
 Signal number to be used for
 .BR SIGEV_SIGNAL .
-.SS Polling message queue descriptors
-On Linux, a message queue descriptor is actually a file descriptor,
-and can be monitored using
+.SS Linux implementation of message queue descriptors
+On Linux, a message queue descriptor is actually a file descriptor.
+(POSIX does not require such an implementation.)
+This means that a message queue descriptor can be monitored using
 .BR select (2),
 .BR poll (2),
 or
 .BR epoll (7).
 This is not portable.
+.PP
+The close-on-exec flag (see
+.BR open (2))
+is automatically set on the file descriptor returned by
+.BR mq_open (2).
 .SS IPC namespaces
 For a discussion of the interaction of System V IPC objects and
 IPC namespaces, see
@@ -358,12 +364,9 @@ POSIX message queues provide a better designed interface than
 System V message queues;
 on the other hand POSIX message queues are less widely available
 (especially on older systems) than System V message queues.
-
+.PP
 Linux does not currently (2.6.26) support the use of access control
 lists (ACLs) for POSIX message queues.
-.SH EXAMPLE
-An example of the use of various message queue functions is shown in
-.BR mq_notify (3).
 .SH BUGS
 In Linux versions 3.5 to 3.14, the kernel imposed a ceiling of 1024
 .RB ( HARD_QUEUESMAX )
@@ -373,7 +376,7 @@ limit could be raised,
 and the ceiling was enforced even for privileged processes.
 This ceiling value was removed in Linux 3.14,
 and patches to stable kernels 3.5.x to 3.13.x also removed the ceiling.
-
+.PP
 As originally implemented (and documented),
 the QSIZE field displayed the total number of (user-supplied)
 bytes in all messages in the message queue.
@@ -387,6 +390,9 @@ This behavioral regression was rectified in Linux 4.2
 (and earlier stable kernel series),
 so that the count once more included just the bytes of user data
 in messages in the queue.
+.SH EXAMPLE
+An example of the use of various message queue functions is shown in
+.BR mq_notify (3).
 .SH SEE ALSO
 .BR getrlimit (2),
 .BR mq_getsetattr (2),