procps-3.1.5 --> procps-3.1.6
+ps: new --ppid option selects by PPID
watch: new --no-title option
handle SPARC Linux badness
rare crash fixed
#define SEL_TTY 11
#define SEL_SESS 12
#define SEL_COMM 13
+#define SEL_PPID 14
/* Since an enum could be smashed by a #define, it would be bad. */
#define U98 0 /* Unix98 standard */ /* This must be 0 */
typedef union sel_union {
pid_t pid;
+ pid_t ppid;
uid_t uid;
gid_t gid;
dev_t tty;
case SEL_FGID: show_gid("FGID", walk->n, walk->u); break;
case SEL_PGRP: show_pid("PGRP", walk->n, walk->u); break;
case SEL_PID : show_pid("PID ", walk->n, walk->u); break;
+ case SEL_PPID: show_pid("PPID", walk->n, walk->u); break;
case SEL_TTY : show_tty("TTY ", walk->n, walk->u); break;
case SEL_SESS: show_pid("SESS", walk->n, walk->u); break;
case SEL_COMM: show_cmd("COMM", walk->n, walk->u); break;
"r only running processes U processes for specified users\n"
"x processes w/o controlling ttys t by tty\n"
"*********** output format ********** *********** long options ***********\n"
-"-o,o user-defined -f full --Group --User --pid --cols\n"
+"-o,o user-defined -f full --Group --User --pid --cols --ppid\n"
"-j,j job control s signal --group --user --sid --rows\n"
"-O,O preloaded -o v virtual memory --cumulative --format --deselect\n"
"-l,l long u user-oriented --sort --tty --forest --version\n"
{"noheading", &&case_noheading},
{"noheadings", &&case_noheadings},
{"pid", &&case_pid},
+ {"ppid", &&case_ppid},
{"rows", &&case_rows},
{"secsid", &&case_secsid},
{"sid", &&case_sid},
if(err) return err;
selection_list->typecode = SEL_PID;
return NULL;
+ case_ppid:
+ trace("--ppid\n");
+ arg = grab_gnu_arg();
+ if(!arg) return "List of process IDs must follow --ppid.";
+ err=parse_list(arg, parse_pid);
+ if(err) return err;
+ selection_list->typecode = SEL_PPID;
+ return NULL;
case_rows:
case_lines:
trace("--rows\n");
--User select by real user name or ID
--group select by effective group name or ID
--pid select by process ID
+--ppid select by parent process ID
--sid select by session ID
--tty select by terminal
--user select by effective user name or ID
break; case SEL_PGRP: return_if_match(pgrp,pid);
break; case SEL_PID : return_if_match(pid,pid);
+ break; case SEL_PPID: return_if_match(ppid,ppid);
break; case SEL_TTY : return_if_match(tty,tty);
break; case SEL_SESS: return_if_match(session,pid);