From 37b9b9a235f3a7e07990e6b7ab983c60089c2490 Mon Sep 17 00:00:00 2001 From: albert <> Date: Mon, 24 Jan 2005 03:37:41 +0000 Subject: [PATCH] valgrind freaked out on some weird old code --- proc/readproc.c | 2 +- ps/output.c | 6 ++++++ ps/parser.c | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/proc/readproc.c b/proc/readproc.c index 581069f4..0c7315d3 100644 --- a/proc/readproc.c +++ b/proc/readproc.c @@ -725,7 +725,7 @@ proc_t* readproc(PROCTAB *restrict const PT, proc_t *restrict p) { proc_t *ret; proc_t *saved_p; - if (PT->did_fake) PT->did_fake=0; + PT->did_fake=0; // if (PT->taskdir) { // closedir(PT->taskdir); // PT->taskdir = NULL; diff --git a/ps/output.c b/ps/output.c index 340bb1b4..f4e4beab 100644 --- a/ps/output.c +++ b/ps/output.c @@ -1260,6 +1260,7 @@ static const format_struct format_array[] = { {"cpuid", "CPUID", pr_psr, sr_nop, 5, 0, BSD, TO|RIGHT}, // OpenBSD: 8 wide! {"cputime", "TIME", pr_time, sr_nop, 8, 0, DEC, ET|RIGHT}, /*time*/ {"cstime", "-", pr_nop, sr_cstime, 1, 0, LNX, AN|RIGHT}, +{"ctid", "CTID", pr_nop, sr_nop, 5, 0, SUN, ET|RIGHT}, // resource contracts? {"cursig", "CURSIG", pr_nop, sr_nop, 6, 0, DEC, AN|RIGHT}, {"cutime", "-", pr_nop, sr_cutime, 1, 0, LNX, AN|RIGHT}, {"cwd", "CWD", pr_nop, sr_nop, 3, 0, LNX, AN|LEFT}, @@ -1357,6 +1358,8 @@ static const format_struct format_array[] = { {"priority", "PRI", pr_priority, sr_priority, 3, 0, LNX, TO|RIGHT}, {"prmgrp", "PRMGRP", pr_nop, sr_nop, 12, 0, HPU, PO|RIGHT}, {"prmid", "PRMID", pr_nop, sr_nop, 12, 0, HPU, PO|RIGHT}, +{"project", "PROJECT", pr_nop, sr_nop, 12, 0, SUN, PO|LEFT}, // see prm* andctid +{"projid", "PROJID", pr_nop, sr_nop, 5, 0, SUN, PO|RIGHT}, {"pset", "PSET", pr_nop, sr_nop, 4, 0, DEC, TO|RIGHT}, {"psr", "PSR", pr_psr, sr_nop, 3, 0, DEC, TO|RIGHT}, {"psxpri", "PPR", pr_nop, sr_nop, 3, 0, DEC, TO|RIGHT}, @@ -1411,6 +1414,7 @@ static const format_struct format_array[] = { {"svuser", "SVUSER", pr_suser, sr_suser, 8, USR, LNX, ET|USER}, {"systime", "SYSTEM", pr_nop, sr_nop, 6, 0, DEC, ET|RIGHT}, {"sz", "SZ", pr_sz, sr_nop, 5, 0, HPU, PO|RIGHT}, +{"taskid", "TASKID", pr_nop, sr_nop, 5, 0, SUN, TO|PIDMAX|RIGHT}, // is this a thread ID? {"tdev", "TDEV", pr_nop, sr_nop, 4, 0, XXX, AN|RIGHT}, {"thcount", "THCNT", pr_nlwp, sr_nlwp, 5, 0, AIX, PO|RIGHT}, {"tid", "TID", pr_thread, sr_tid, 5, 0, AIX, TO|PIDMAX|RIGHT}, @@ -1453,6 +1457,8 @@ static const format_struct format_array[] = { {"wchan", "WCHAN", pr_wchan, sr_wchan, 6, WCH, XXX, TO|WCHAN}, /* BSD n forces this to nwchan */ /* was 10 wide */ {"wname", "WCHAN", pr_wname, sr_nop, 6, WCH, SGI, TO|WCHAN}, /* opposite of nwchan */ {"xstat", "XSTAT", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, +{"zone", "ZONE", pr_context, sr_nop, 31, 0, SUN, ET|LEFT}, // Solaris zone == Linux context? +{"zoneid", "ZONEID", pr_nop, sr_nop, 31, 0, SUN, ET|RIGHT},// Linux only offers context names {"~", "-", pr_nop, sr_nop, 1, 0, LNX, AN|RIGHT} /* NULL would ruin alphabetical order */ }; diff --git a/ps/parser.c b/ps/parser.c index 6cb6d388..06601225 100644 --- a/ps/parser.c +++ b/ps/parser.c @@ -478,6 +478,15 @@ static const char *parse_sysv_option(void){ trace("-z shows aliased MAC info\n"); format_modifiers |= FM_M; break; + // Solaris 10 does this + case 'z': /* select by zone */ + trace("-z secects by zone\n"); + arg=get_opt_arg(); + if(!arg) return "List of zones (contexts, labels, whatever?) must follow -z."; + err=parse_list(arg, parse_zone); + if(err) return err; + selection_list->typecode = SEL_ZONE; + return NULL; /* can't have any more options */ #endif case '-': return "Embedded '-' among SysV options makes no sense.";