bin/59423: [PATCH] ps: show 'sid' keyword in '-j'
Jilles Tjoelker
jilles at stack.nl
Tue Nov 18 08:40:21 PST 2003
>Number: 59423
>Category: bin
>Synopsis: [PATCH] ps: show 'sid' keyword in '-j'
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Nov 18 08:40:17 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Jilles Tjoelker
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
MCGV Stack
>Environment:
System: FreeBSD turtle.stack.nl 5.1-CURRENT FreeBSD 5.1-CURRENT #15: Thu Oct 9 11:43:55 CEST 2003 jilles at turtle.stack.nl:/usr/obj/usr/src/sys/TURTLE i386
FreeBSD 5-CURRENT
>Description:
Under FreeBSD 4.x, ps -j showed the keywords:
user,pid,ppid,pgid,sess,jobc,state,tt,time,command
Under FreeBSD 5.x, the sess keyword (session pointer) was abandoned, and (as a
more useful replacement) the sid keyword (session id, PID of session leader)
was introduced. However, the sess keyword was simply removed from ps -j instead
of being replaced by sid.
>How-To-Repeat:
without patch
$ ps -j -p $$
USER PID PPID PGID JOBC STAT TT TIME COMMAND
jilles 52879 52843 52793 1 S+ p8 0:00.00 /usr/local/bin/bash
with patch
$ ps -j -p $$
USER PID PPID PGID SID JOBC STAT TT TIME COMMAND
jilles 52879 52843 52793 5900 1 S+ p8 0:00.00 /usr/local/bin/bash
>Fix:
A patch is included to add the sid keyword to the list for '-j'.
--- ps-j-sid.patch begins here ---
--- /usr/src/bin/ps/ps.c Fri Jun 13 04:00:04 2003
+++ /usr/src/bin/ps/ps.c Fri Oct 10 17:50:46 2003
@@ -102,7 +102,7 @@
static uid_t *getuids(const char *, int *);
static char dfmt[] = "pid,tt,state,time,command";
-static char jfmt[] = "user,pid,ppid,pgid,jobc,state,tt,time,command";
+static char jfmt[] = "user,pid,ppid,pgid,sid,jobc,state,tt,time,command";
static char lfmt[] = "uid,pid,ppid,cpu,pri,nice,vsz,rss,mwchan,state,tt,time,command";
static char o1[] = "pid";
static char o2[] = "tt,state,time,command";
--- /usr/src/bin/ps/ps.1.orig Tue Sep 9 04:00:05 2003
+++ /usr/src/bin/ps/ps.1 Tue Nov 18 16:26:23 2003
@@ -109,7 +109,7 @@
header per page of information.
.It Fl j
Print information associated with the following keywords:
-user, pid, ppid, pgid, jobc, state, tt, time and command.
+user, pid, ppid, pgid, sid, jobc, state, tt, time and command.
.It Fl L
List the set of available keywords.
.It Fl l
--- ps-j-sid.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list