Skip to contentSkip to conversation

proc.5: document 'subset' mount option.

PATCH In review [email protected] 2 participants 2 messages May 14, 2024 – May 17, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 proc.5: document 'subset' mount option.

From: Matteo Croce <[email protected]>

The 'subset=pid' option was added in commit 6814ef2d, document it. This option mounts a procfs where only the numeric directories related to the PIDs are present.

	# mount -t proc proc_pid pid -o subset=pid
	# mount |grep -w proc_pid
	proc_pid on /tmp/proc/pid type proc (rw,relatime,subset=pid)
	# ll -d pid/{1,$$,cmdline,version}
	ls: cannot access 'pid/cmdline': No such file or directory
	ls: cannot access 'pid/version': No such file or directory
	dr-xr-xr-x. 9 root root 0 May 14 09:43 pid/1
	dr-xr-xr-x. 9 root root 0 May 14 09:43 pid/25146

The only non-numeric entries in that procfs instance are 'self' and 'thread-self':

	# ls pid |grep -vx '[[:digit:]]*'
	self
	thread-self
	#
---
 man/man5/proc.5 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
man/man5/proc.5 +6 -1
index 8022ca49e..cdb4aa859 100644
@@ -105,7 +105,12 @@ This group should be used instead of approaches such as putting
 nonroot users into the
 .BR sudoers (5)
 file.
-.\"
+.RE
+.TP
+.BR subset = pid " (since Linux 5.8)"
+.\" commit 6814ef2d992af09451bbeda4770daa204461329e
+Show only the specified subset of procfs hiding all top level files
+and directories in the procfs that are not related to tasks.
 .SS Overview
 Underneath
 .IR /proc ,
Signature · 1 line
2.43.0
#1 lore raw

Hi Matteo,

Quoted 19 lines · On Tue, May 14, 2024 at 10:28:19PM GMT, [email protected] wrote:

From: Matteo Croce <[email protected]>

The 'subset=pid' option was added in commit 6814ef2d, document it. This option mounts a procfs where only the numeric directories related to the PIDs are present.

	# mount -t proc proc_pid pid -o subset=pid
	# mount |grep -w proc_pid
	proc_pid on /tmp/proc/pid type proc (rw,relatime,subset=pid)
	# ll -d pid/{1,$$,cmdline,version}
	ls: cannot access 'pid/cmdline': No such file or directory
	ls: cannot access 'pid/version': No such file or directory
	dr-xr-xr-x. 9 root root 0 May 14 09:43 pid/1
	dr-xr-xr-x. 9 root root 0 May 14 09:43 pid/25146

The only non-numeric entries in that procfs instance are 'self' and 'thread-self':

Quoted 6 lines
	# ls pid |grep -vx '[[:digit:]]*'
	self
	thread-self
	#

I've applied the patch, with minor fixes (grep for 'semantic newlines' in man-pages(7)), such as a comma, and different line breaks.

<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=dd465607bc5817819f1e90eb66468e7d9cf9e0b1>

Have a lovely night!
Alex

Quoted 25 lines
---
 man/man5/proc.5 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
man/man5/proc.5 +6 -1
index 8022ca49e..cdb4aa859 100644
@@ -105,7 +105,12 @@ This group should be used instead of approaches such as putting
 nonroot users into the
 .BR sudoers (5)
 file.
-.\"
+.RE
+.TP
+.BR subset = pid " (since Linux 5.8)"
+.\" commit 6814ef2d992af09451bbeda4770daa204461329e
+Show only the specified subset of procfs hiding all top level files
+and directories in the procfs that are not related to tasks.
 .SS Overview
 Underneath
 .IR /proc ,
Signature · 1 line
2.43.0
Signature · 1 line
<https://www.alejandro-colomar.es/>