OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / mq_open.3
index 514e9c6..611ea59 100644 (file)
@@ -1,8 +1,7 @@
 '\" t
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -22,8 +21,9 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
-.TH MQ_OPEN 3 2009-02-20 "Linux" "Linux Programmer's Manual"
+.TH MQ_OPEN 3 2014-12-31 "Linux" "Linux Programmer's Manual"
 .SH NAME
 mq_open \- open a message queue
 .SH SYNOPSIS
@@ -70,14 +70,12 @@ Zero or more of the following flags can additionally be
 in
 .IR oflag :
 .TP
-.B O_NONBLOCK
-Open the queue in nonblocking mode.
-In circumstances where
-.BR mq_receive (3)
-and
-.BR mq_send (3)
-would normally block, these functions instead fail with the error
-.BR EAGAIN .
+.BR O_CLOEXEC " (since Linux 2.6.26)"
+.\" commit 269f21344b23e552c21c9e2d7ca258479dcd7a0a
+Set the close-on-exec flag for the message queue descriptor.
+See
+.BR open (2)
+for a discussion of why this flag is useful.
 .TP
 .B O_CREAT
 Create the message queue if it does not exist.
@@ -85,7 +83,7 @@ The owner (user ID) of the message queue is set to the effective
 user ID of the calling process.
 The group ownership (group ID) is set to the effective group ID
 of the calling process.
-.\" In reality the file system IDs are used on Linux.
+.\" In reality the filesystem IDs are used on Linux.
 .TP
 .B O_EXCL
 If
@@ -96,6 +94,15 @@ and a queue with the given
 .I name
 already exists, then fail with the error
 .BR EEXIST .
+.TP
+.B O_NONBLOCK
+Open the queue in nonblocking mode.
+In circumstances where
+.BR mq_receive (3)
+and
+.BR mq_send (3)
+would normally block, these functions instead fail with the error
+.BR EAGAIN .
 .PP
 If
 .B O_CREAT
@@ -110,6 +117,7 @@ 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
 .I attr
 argument specifies attributes for the queue.
@@ -120,6 +128,11 @@ If
 .I attr
 is NULL, then the queue is created with implementation-defined
 default attributes.
+Since Linux 3.5, two
+.I /proc
+files can be used to control these defaults; see
+.BR mq_overview (7)
+for details.
 .SH RETURN VALUE
 On success,
 .BR mq_open ()
@@ -221,13 +234,18 @@ This probably occurred because the
 .I queues_max
 limit was encountered; see
 .BR mq_overview (7).
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR mq_open ()
+function is thread-safe.
 .SH CONFORMING TO
 POSIX.1-2001.
 .SH BUGS
 In kernels before 2.6.14,
 the process umask was not applied to the permissions specified in
 .IR mode .
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR mq_close (3),
 .BR mq_getattr (3),
 .BR mq_notify (3),
@@ -235,3 +253,12 @@ the process umask was not applied to the permissions specified in
 .BR mq_send (3),
 .BR mq_unlink (3),
 .BR mq_overview (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.