]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/semctl.2
pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2...
[thirdparty/man-pages.git] / man2 / semctl.2
index 129156c2bd5f6853a6296a47e033ca2dbf601253..6fd0abc07cd13676b96e80e4174c545e5d41d89c 100644 (file)
@@ -37,8 +37,9 @@
 .\"    Rewrote semun text
 .\"    Added semid_ds and ipc_perm structure definitions
 .\" 2005-08-02, mtk: Added IPC_INFO, SEM_INFO, SEM_STAT descriptions.
+.\" 2018-03-20, dbueso: Added SEM_STAT_ANY description.
 .\"
-.TH SEMCTL 2 2016-10-08 "Linux" "Linux Programmer's Manual"
+.TH SEMCTL 2 2019-08-02 "Linux" "Linux Programmer's Manual"
 .SH NAME
 semctl \- System V semaphore control operations
 .SH SYNOPSIS
@@ -67,7 +68,7 @@ When there are four, the fourth has the type
 The \fIcalling program\fP must define this union as follows:
 .PP
 .in +4n
-.nf
+.EX
 union semun {
     int              val;    /* Value for SETVAL */
     struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
@@ -75,7 +76,7 @@ union semun {
     struct seminfo  *__buf;  /* Buffer for IPC_INFO
                                 (Linux-specific) */
 };
-.fi
+.EE
 .in
 .PP
 The
@@ -90,7 +91,7 @@ struct semid_ds {
     time_t          sem_ctime; /* Last change time */
     unsigned long   sem_nsems; /* No. of semaphores in set */
 };
-.fi
+.EE
 .in
 .PP
 The
@@ -100,7 +101,7 @@ structure is defined as follows
 .BR IPC_SET ):
 .PP
 .in +4n
-.nf
+.EX
 struct ipc_perm {
     key_t          __key; /* Key supplied to semget(2) */
     uid_t          \fBuid\fP;   /* Effective UID of owner */
@@ -110,7 +111,7 @@ struct ipc_perm {
     unsigned short \fBmode\fP;  /* Permissions */
     unsigned short __seq; /* Sequence number */
 };
-.fi
+.EE
 .in
 .PP
 Valid values for
@@ -240,6 +241,19 @@ argument is not a semaphore identifier, but instead an index into
 the kernel's internal array that maintains information about
 all semaphore sets on the system.
 .TP
+.BR SEM_STAT_ANY " (Linux-specific, since Linux 4.17)"
+Return a
+.I seminfo
+structure containing the same information as for
+.BR SEM_STAT .
+However,
+.I sem_perm.mode
+is not checked for read access for
+.IR semid
+meaning that any user can employ this operation (just as any user may read
+.IR /proc/sysvipc/sem
+to obtain the same information).
+.TP
 .B GETALL
 Return
 .B semval
@@ -368,6 +382,8 @@ kernel's internal array recording information about all
 semaphore sets.
 (This information can be used with repeated
 .B SEM_STAT
+or
+.B SEM_STAT_ANY
 operations to obtain information about all semaphore sets on the system.)
 .TP
 .B SEM_INFO
@@ -377,6 +393,10 @@ as for
 .B SEM_STAT
 the identifier of the semaphore set whose index was given in
 .IR semid .
+.TP
+.B SEM_STAT_ANY
+as for
+.BR SEM_STAT .
 .PP
 All other
 .I cmd
@@ -397,6 +417,7 @@ has one of the values
 .BR GETZCNT ,
 .BR IPC_STAT ,
 .BR SEM_STAT ,
+.BR SEM_STAT_ANY ,
 .BR SETALL ,
 or
 .B SETVAL
@@ -581,4 +602,4 @@ in Linux 4.6.
 .BR semop (2),
 .BR capabilities (7),
 .BR sem_overview (7),
-.BR svipc (7)
+.BR sysvipc (7)