proc.5: clarify cmdline mutability
Hi Mike,
Quoted 8 lines · Mike Frysinger
From: Mike Frysinger <[email protected]>
The cmdline file is a window into memory that is controlled by the target process, and that memory may be changed arbitrarily, as can the window via prctl settings. Make sure people understand that this file is all an illusion.
Signed-off-by Mike Frysinger <[email protected]>
Thanks. Patch applied.
Cheers,
Michael
Quoted 28 lines
--- man5/proc.5 | 12 ++++++++++++ 1 file changed, 12 insertions(+)man5/proc.5 +12
-0@@ -435,6 +435,18 @@ that is, a read on this file will return 0 characters. The command-line arguments appear in this file as a set of strings separated by null bytes (\(aq\\0\(aq), with a further null byte after the last string. +.IP +If, after an +.BR execve (2), +the process modifies its argv strings, those changes will show up here. +This is not the same thing as modifying the argv array. +.IP +Furthermore, a process may change the memory location that this file refers via +.BR prctl (2) +operations such as +.BR PR_SET_MM_ARG_START . +.IP +Think of this file as the command line that the process wants you to see. .TP .IR /proc/[pid]/comm " (since Linux 2.6.33)" .\" commit 4614a696bd1c3a9af3a08f0e5874830a85b889d4
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/