Re: [PATCH] shmctl.2, semctl.2, msgctl.2: add STAT_ANY commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please see https://lkml.org/lkml/2018/3/20/715

On Fri, 22 Jun 2018, Joe Lawrence wrote:

The linux kernel has added STAT_ANY variants to the shmctl(), semctl(),
and msgctl() shared memory functions.  Add descriptions for these new
cmd values.

The text is adopted directly from Davidlohr Bueso's <dave@xxxxxxxxxxxx>
upstream linux kernel commits:

 ipc/shm: introduce shmctl(SHM_STAT_ANY)
 ipc/sem: introduce semctl(SEM_STAT_ANY)
 ipc/msg: introduce msgctl(MSG_STAT_ANY)

Signed-off-by: Joe Lawrence <joe.lawrence@xxxxxxxxxx>
---
man2/msgctl.2 | 21 +++++++++++++++++++--
man2/semctl.2 | 23 +++++++++++++++++++++--
man2/shmctl.2 | 20 ++++++++++++++++++--
3 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/man2/msgctl.2 b/man2/msgctl.2
index df74c750457a..00c641a5cb53 100644
--- a/man2/msgctl.2
+++ b/man2/msgctl.2
@@ -33,6 +33,9 @@
.\"	Language and formatting clean-ups
.\"	Added msqid_ds and ipc_perm structure definitions
.\" 2005-08-02, mtk: Added IPC_INFO, MSG_INFO, MSG_STAT descriptions
+.\" 2018-07-22, Joe Lawrence <joe.lawrence@xxxxxxxxxx>:
+.\"	Added MSG_STAT_ANY description, based on SHM_STAT_ANY text from
+.\"	Davidlohr Bueso.
.\"
.TH MSGCTL 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
@@ -226,6 +229,18 @@ However, the
argument is not a queue identifier, but instead an index into
the kernel's internal array that maintains information about
all message queues on the system.
+.TP
+.BR MSG_STAT_ANY " (Linux-specific)"
+Return a
+.I msqid_ds
+structure as for
+.BR MSG_STAT .
+However, the
+.I msg_perm.mode
+is not checked for read access for
+.IR shmid ,
+resembing the behaviour of
+/proc/sysvipc/msg.
.SH RETURN VALUE
On success,
.BR IPC_STAT ,
@@ -241,10 +256,12 @@ operation returns the index of the highest used entry in the
kernel's internal array recording information about all
message queues.
(This information can be used with repeated
-.B MSG_STAT
+.B MSG_STAT/MSG_STAT_ANY
operations to obtain information about all queues on the system.)
A successful
.B MSG_STAT
+or
+.B MSG_STAT_ANY
operation returns the identifier of the queue whose index was given in
.IR msqid .
.PP
@@ -289,7 +306,7 @@ Invalid value for
or
.IR msqid .
Or: for a
-.B MSG_STAT
+.B MSG_STAT/MSG_STAT_ANY
operation, the index value specified in
.I msqid
referred to an array slot that is currently unused.
diff --git a/man2/semctl.2 b/man2/semctl.2
index 02930d2c74ae..5c3dcdbf4a89 100644
--- a/man2/semctl.2
+++ b/man2/semctl.2
@@ -37,6 +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-07-22, Joe Lawrence <joe.lawrence@xxxxxxxxxx>:
+.\"	Added SEM_STAT_ANY description, based on SHM_STAT_ANY text from
+.\"	Davidlohr Bueso.
.\"
.TH SEMCTL 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
@@ -240,6 +243,18 @@ 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)"
+Return a
+.I semid_ds
+structure as for
+.BR SEM_STAT .
+However, the
+.I sem_perm.mode
+is not checked for read access for
+.IR semid ,
+resembing the behaviour of
+/proc/sysvipc/sem.
+.TP
.B GETALL
Return
.B semval
@@ -367,7 +382,7 @@ the index of the highest used entry in the
kernel's internal array recording information about all
semaphore sets.
(This information can be used with repeated
-.B SEM_STAT
+.B SEM_STAT/SEM_STAT_ANY
operations to obtain information about all semaphore sets on the system.)
.TP
.B SEM_INFO
@@ -377,6 +392,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
@@ -421,7 +440,7 @@ Invalid value for
or
.IR semid .
Or: for a
-.B SEM_STAT
+.B SEM_STAT/SEM_STAT_ANY
operation, the index value specified in
.I semid
referred to an array slot that is currently unused.
diff --git a/man2/shmctl.2 b/man2/shmctl.2
index 7bb503999941..86fbc5853f19 100644
--- a/man2/shmctl.2
+++ b/man2/shmctl.2
@@ -41,6 +41,8 @@
.\" 2005-04-25, mtk -- noted aberrant Linux behavior w.r.t. new
.\"	attaches to a segment that has already been marked for deletion.
.\" 2005-08-02, mtk: Added IPC_INFO, SHM_INFO, SHM_STAT descriptions.
+.\" 2018-07-22, Joe Lawrence <joe.lawrence@xxxxxxxxxx>:
+.\"	Added SHM_STAT_ANY description from Davidlohr Bueso.
.\"
.TH SHMCTL 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
@@ -242,6 +244,18 @@ However, the
argument is not a segment identifier, but instead an index into
the kernel's internal array that maintains information about
all shared memory segments on the system.
+.TP
+.BR SHM_STAT_ANY " (Linux-specific)"
+Return a
+.I shmid_ds
+structure as for
+.BR SHM_STAT .
+However, the
+.I shm_perm.mode
+is not checked for read access for
+.IR shmid ,
+resembing the behaviour of
+/proc/sysvipc/shm.
.PP
The caller can prevent or allow swapping of a shared
memory segment with the following \fIcmd\fP values:
@@ -287,11 +301,13 @@ operation returns the index of the highest used entry in the
kernel's internal array recording information about all
shared memory segments.
(This information can be used with repeated
-.B SHM_STAT
+.B SHM_STAT/SHM_STAT_ANY
operations to obtain information about all shared memory segments
on the system.)
A successful
.B SHM_STAT
+or
+.B SHM_STAT_ANY
operation returns the identifier of the shared memory segment
whose index was given in
.IR shmid .
@@ -328,7 +344,7 @@ isn't accessible.
\fIshmid\fP is not a valid identifier, or \fIcmd\fP
is not a valid command.
Or: for a
-.B SHM_STAT
+.B SHM_STAT/SHM_STAT_ANY
operation, the index value specified in
.I shmid
referred to an array slot that is currently unused.
--
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux