Skip to contentSkip to conversation

proc.5: Inform that comm in /proc/pid/{stat,status} might also be truncated

PATCH In review Arkadiusz Drabczyk 2 participants 2 messages Jun 17, 2020 – Jun 19, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc.5: Inform that comm in /proc/pid/{stat,status} might also be truncated

pgrep for example searches for a process name in /proc/pid/status and therefore cannot find processes whose names are longer than 15 characters unless -f is specified.

---
 man5/proc.5 | 6 ++++++
 1 file changed, 6 insertions(+)
man5/proc.5 +6 -0
index 538c6c6..edaf281 100644
@@ -2089,6 +2089,9 @@ The process ID.
 .TP
 (2) \fIcomm\fP \ %s
 The filename of the executable, in parentheses.
+Strings longer than
+.B TASK_COMM_LEN
+(16) characters (including the terminating null byte) are silently truncated.
 This is visible whether or not the executable is swapped out.
 .TP
 (3) \fIstate\fP \ %c
@@ -2504,6 +2507,9 @@ The fields are as follows:
 .IP * 2
 .IR Name :
 Command run by this process.
+Strings longer than
+.B TASK_COMM_LEN
+(16) characters (including the terminating null byte) are silently truncated.
 .IP *
 .IR Umask :
 Process umask, expressed in octal with a leading zero; see
Signature · 1 line
2.9.0
#1 lore raw

Hello Arkadiusz,

Quoted 5 lines · Arkadiusz Drabczyk

pgrep for example searches for a process name in /proc/pid/status and therefore cannot find processes whose names are longer than 15 characters unless -f is specified.

Thanks. Patch applied.

Cheers,

Michael

Quoted 29 lines
---
 man5/proc.5 | 6 ++++++
 1 file changed, 6 insertions(+)
man5/proc.5 +6 -0
index 538c6c6..edaf281 100644
@@ -2089,6 +2089,9 @@ The process ID.
 .TP
 (2) \fIcomm\fP \ %s
 The filename of the executable, in parentheses.
+Strings longer than
+.B TASK_COMM_LEN
+(16) characters (including the terminating null byte) are silently truncated.
 This is visible whether or not the executable is swapped out.
 .TP
 (3) \fIstate\fP \ %c
@@ -2504,6 +2507,9 @@ The fields are as follows:
 .IP * 2
 .IR Name :
 Command run by this process.
+Strings longer than
+.B TASK_COMM_LEN
+(16) characters (including the terminating null byte) are silently truncated.
 .IP *
 .IR Umask :
 Process umask, expressed in octal with a leading zero; see
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/