From 0795997fccfae312fac9502d46af75b8861e0294 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 28 Mar 1995 18:16:35 +0000 Subject: Add support for the exec_flags field, and make the state bits calculation use that to support the PSTAT_STATE_TRACED bit. Update proc_stat_state_tags to add PSTAT_STATE_TRACED. --- libps/procstat.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libps/procstat.c') diff --git a/libps/procstat.c b/libps/procstat.c index 979d98b8..4cb77473 100644 --- a/libps/procstat.c +++ b/libps/procstat.c @@ -31,7 +31,7 @@ /* These directly correspond to the bits in a state, starting from 0. See ps.h for an explanation of what each of these means. */ -char *proc_stat_state_tags = "RTHDSIWN). */ + MGET(PSTAT_EXEC_FLAGS, PSTAT_MSGPORT | PSTAT_TASK, + msg_get_exec_flags(ps->msgport, ps->task, &ps->exec_flags)); + /* PSTAT_STATE_ bits for the process and all its threads. */ if ((need & PSTAT_STATE) && (have & PSTAT_INFO)) { @@ -235,6 +241,9 @@ proc_stat_set_flags(proc_stat_t ps, int flags) if (pi_flags & PI_ORPHAN) state |= PSTAT_STATE_ORPHANED; + if ((have & PSTAT_EXEC_FLAGS) & (ps->exec_flags & EXEC_TRACED)) + state |= PSTAT_STATE_TRACED; + ps->state = state; have |= PSTAT_STATE; } -- cgit v1.2.3