summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-06-22 01:59:54 +0000
committergad <gad@FreeBSD.org>2004-06-22 01:59:54 +0000
commit09466dade0e65526a2c25d08006f905436813799 (patch)
treebdcadd8de00af88003f109c2440605343b38fdc4 /bin/ps
parent16254a8419de6b9a12b023852a64bcc6cf4d492b (diff)
downloadFreeBSD-src-09466dade0e65526a2c25d08006f905436813799.zip
FreeBSD-src-09466dade0e65526a2c25d08006f905436813799.tar.gz
When displaying the "COMMAND" field for system-processes and/or kernel
threads, put the command name in square brackets instead of parenthesis. This matches NetBSD, and also seems to be what linux does. The sentence which is added to the man page is taken straight from NetBSD. PR: bin/65803 Submitted by: Cyrille Lefevre Obtained from: NetBSD
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/fmt.c2
-rw-r--r--bin/ps/ps.13
2 files changed, 4 insertions, 1 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c
index 07b27cb..d6e0109 100644
--- a/bin/ps/fmt.c
+++ b/bin/ps/fmt.c
@@ -123,7 +123,7 @@ fmt_argv(char **argv, char *cmd, size_t maxlen)
if (cp == NULL)
errx(1, "malloc failed");
if (ap == NULL)
- sprintf(cp, " (%.*s)", (int)maxlen, cmd);
+ sprintf(cp, "[%.*s]", (int)maxlen, cmd);
else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd);
else
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 9b3db2b..7ec5a4b 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -414,6 +414,9 @@ is listed as
and a process which is blocked while trying
to exit is listed as
.Dq Li <exiting> .
+If the command vector cannot be located (usually because it has not
+been set, as is the case of system processes and/or kernel threads)
+the command name is printed within square brackets.
The
.Nm
utility
OpenPOWER on IntegriCloud