From b447cd586d95a2e3617245e9fbf2bbeb26782472 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 22 Feb 2008 07:41:04 +0000 Subject: [PATCH] Update /proc/[number]/cmdline description. It used to be true that the command line arguments were not accessible when the process had been swapped out. In ancient kernels (circa 2.0.*) the problem was that the kernel relied on get_phys_addr to access the user space buffer, which stopped working as soon as the process was swapped out. Recent kernels use get_user_pages for the same purpose and thus they should not have that limitation. --- man5/proc.5 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/man5/proc.5 b/man5/proc.5 index e833fd6c8..431a9dbb4 100644 --- a/man5/proc.5 +++ b/man5/proc.5 @@ -87,11 +87,12 @@ plus one \fIunsigned long\fP value for each entry. The last entry contains two zeros. .TP .I /proc/[number]/cmdline -This holds the complete command line for the process, unless the whole -process has been swapped out or the process is a zombie. -In either of these latter cases, there is nothing in this file: +This holds the complete command line for the process, +unless the process is a zombie. +.\" In 2.3.26, this also used to be true if the process was swapped out. +In the latter case, there is nothing in this file: that is, a read on this file will return 0 characters. -The command line arguments appear in this file as a set of +The command-line arguments appear in this file as a set of null-separated strings, with a further null byte after the last string. .TP .I /proc/[number]/cwd