Subject: Re: bin/7506: ps output format fails for -j (blame SESS)
To: matthew green <mrg@eterna.com.au>
From: Geoff Wing <gcw@pobox.com>
List: netbsd-bugs
Date: 05/03/1999 03:28:01
matthew green wrote about re: bin/7506: ps output format fails for -j (blame SESS):
:i imagine that the session should have the first two letters
:removed (eg, `f0' in your example) as this is (probably) the
:base of memory.  at least, that's what the original intent
:would have been, as it is used elsewhere in the tree.

Given that that is the case, then you have a special case and could use
the following patch instead:

*** /usr/src/bin/ps/keyword.c	Wed Feb 18 23:06:12 1998
--- /obj/src/bin/ps/keyword.c	Mon May  3 03:22:40 1999
***************
*** 149,155 ****
  	{"rsz", "RSZ", NULL, 0, rssize, 4},
  	UID("ruid", "RUID", evar, EOFF(e_pcred.p_ruid)),
  	{"ruser", "RUSER", NULL, LJUST, runame, USERLEN},
! 	{"sess", "SESS", NULL, 0, evar, 6, EOFF(e_sess), KPTR, "x"},
  	PID("sid", "SID", evar, EOFF(e_sid)),
  	{"sig", "PENDING", NULL, 0, pvar, 8, POFF(p_siglist), INT, "x"},
  	{"sigcatch", "CAUGHT", NULL, 0, pvar, 8, POFF(p_sigcatch), UINT, "x"},
--- 149,155 ----
  	{"rsz", "RSZ", NULL, 0, rssize, 4},
  	UID("ruid", "RUID", evar, EOFF(e_pcred.p_ruid)),
  	{"ruser", "RUSER", NULL, LJUST, runame, USERLEN},
! 	{"sess", "SESS", NULL, 0, evar, 6, EOFF(e_sess), KPTR24, "x"},
  	PID("sid", "SID", evar, EOFF(e_sid)),
  	{"sig", "PENDING", NULL, 0, pvar, 8, POFF(p_siglist), INT, "x"},
  	{"sigcatch", "CAUGHT", NULL, 0, pvar, 8, POFF(p_sigcatch), UINT, "x"},

*** /usr/src/bin/ps/print.c	Wed Jul 29 21:03:41 1998
--- /obj/src/bin/ps/print.c	Mon May  3 03:22:31 1999
***************
*** 724,729 ****
--- 724,732 ----
  	case KPTR:
  		(void)printf(ofmt, v->width, GET(u_long));
  		break;
+ 	case KPTR24:
+ 		(void)printf(ofmt, v->width, GET(u_long) & 0xffffff);
+ 		break;
  	default:
  		errx(1, "unknown type %d", v->type);
  	}

*** /usr/src/bin/ps/ps.h	Tue Oct 15 01:23:11 1996
--- /obj/src/bin/ps/ps.h	Mon May  3 03:22:54 1999
***************
*** 37,43 ****
  
  #define	UNLIMITED	0	/* unlimited terminal width */
  enum type {
! 	CHAR, UCHAR, SHORT, USHORT, INT, UINT, LONG, ULONG, KPTR,
  	INT32, UINT32
  };
  
--- 37,43 ----
  
  #define	UNLIMITED	0	/* unlimited terminal width */
  enum type {
! 	CHAR, UCHAR, SHORT, USHORT, INT, UINT, LONG, ULONG, KPTR, KPTR24,
  	INT32, UINT32
  };
  

-- 
Geoff Wing   <gcw@pobox.com>     NEW>>>>Mobile : (Australia) 0413 431 874
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/