]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/msgget.2
pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2...
[thirdparty/man-pages.git] / man2 / msgget.2
index 342762ea2de3c31cd71b5d1085a840b19ada6bd9..b7b95b66e4d575d37b4e66eb9d05e0dc3f77e50b 100644 (file)
@@ -32,7 +32,7 @@
 .\"    Language and formatting clean-ups
 .\"    Added notes on /proc files
 .\"
-.TH MSGGET 2 2012-05-31 "Linux" "Linux Programmer's Manual"
+.TH MSGGET 2 2019-08-02 "Linux" "Linux Programmer's Manual"
 .SH NAME
 msgget \- get a System V message queue identifier
 .SH SYNOPSIS
@@ -40,16 +40,25 @@ msgget \- get a System V message queue identifier
 .B #include <sys/types.h>
 .B #include <sys/ipc.h>
 .B #include <sys/msg.h>
-
+.PP
 .BI "int msgget(key_t " key ", int " msgflg );
 .fi
 .SH DESCRIPTION
 The
 .BR msgget ()
-system call returns the System V message queue identifier associated
+system call returns the System\ V message queue identifier associated
 with the value of the
 .I key
 argument.
+It may be used either to obtain the identifier of a previously created
+message queue (when
+.I msgflg
+is zero and
+.I key
+does not have the value
+.BR IPC_PRIVATE ),
+or to create a new set.
+.PP
 A new message queue is created if
 .I key
 has the value
@@ -151,17 +160,16 @@ A message queue exists for
 but the calling process does not have permission to access the queue,
 and does not have the
 .B CAP_IPC_OWNER
-capability.
+capability in the user namespace that governs its IPC namespace.
 .TP
 .B EEXIST
-A message queue exists for
-.I key
-and
-.I msgflg
-specified both
 .B IPC_CREAT
 and
-.BR IPC_EXCL .
+.BR IPC_EXCL
+were specified in
+.IR msgflg ,
+but a message queue already exists for
+.IR key .
 .TP
 .B ENOENT
 No message queue exists for
@@ -181,7 +189,7 @@ number of message queues
 .RB ( MSGMNI )
 would be exceeded.
 .SH CONFORMING TO
-SVr4, POSIX.1-2001.
+POSIX.1-2001, POSIX.1-2008, SVr4.
 .SH NOTES
 The inclusion of
 .I <sys/types.h>
@@ -195,7 +203,7 @@ Applications intended to be portable to such old systems may need
 to include these header files.
 .\" Like Linux, the FreeBSD man pages still document
 .\" the inclusion of these header files.
-
+.PP
 .B IPC_PRIVATE
 isn't a flag field but a
 .I key_t
@@ -211,12 +219,16 @@ The following is a system limit on message queue resources affecting a
 call:
 .TP
 .B MSGMNI
-System wide maximum number of message queues: policy
-dependent
-(on Linux, this limit can be read and modified via
-.IR /proc/sys/kernel/msgmni ).
+System-wide limit on the number of message queues.
+Before Linux 3.19,
+.\" commit 0050ee059f7fc86b1df2527aaa14ed5dc72f9973
+the default value for this limit was calculated using a formula
+based on available system memory.
+Since Linux 3.19, the default value is 32,000.
+On Linux, this limit can be read and modified via
+.IR /proc/sys/kernel/msgmni .
 .SS Linux notes
-Until version 2.3.20 Linux would return
+Until version 2.3.20, Linux would return
 .B EIDRM
 for a
 .BR msgget ()
@@ -234,4 +246,4 @@ would more clearly show its function.
 .BR ftok (3),
 .BR capabilities (7),
 .BR mq_overview (7),
-.BR svipc (7)
+.BR sysvipc (7)