summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-05-02 21:26:12 +0000
committerMiles Bader <miles@gnu.org>1995-05-02 21:26:12 +0000
commite0dfe6c32616a8bee77a5c2420c1f2bf6d933696 (patch)
treedd9d1c034b976220681815f8379d74cac4f66e61
parent105a41afd0d823d8878de8717ef523c2b3f60e39 (diff)
(proc_stat_set_flags, add_preconditions): Add support for the suspend_count
field.
-rw-r--r--libps/procstat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libps/procstat.c b/libps/procstat.c
index fd91669c..b6fe86c6 100644
--- a/libps/procstat.c
+++ b/libps/procstat.c
@@ -88,6 +88,10 @@ add_preconditions (ps_flags_t flags)
flags |= PSTAT_CTTYID;
if (flags & PSTAT_STATE)
flags |= PSTAT_EXEC_FLAGS; /* For the traced bit. */
+ if (flags & PSTAT_SUSPEND_COUNT)
+ /* We just request the resources require for both the thread and task
+ versions, as the extraneous info won't be possible to aquire anyway. */
+ flags |= PSTAT_INFO | PSTAT_THREAD_INFO;
if (flags & (PSTAT_CTTYID | PSTAT_CWDIR | PSTAT_AUTH | PSTAT_UMASK
| PSTAT_EXEC_FLAGS)
&& !(flags & PSTAT_NO_MSGPORT))
@@ -254,6 +258,17 @@ proc_stat_set_flags (proc_stat_t ps, ps_flags_t flags)
have |= PSTAT_THREAD_INFO;
}
+ if ((need & PSTAT_SUSPEND_COUNT)
+ &&
+ ((have & PSTAT_PID) ? (have & PSTAT_INFO) : (have & PSTAT_THREAD_INFO)))
+ {
+ if (have & PSTAT_PID)
+ ps->suspend_count = ps->info->taskinfo.suspend_count;
+ else
+ ps->suspend_count = ps->thread_basic_info.suspend_count;
+ have |= PSTAT_SUSPEND_COUNT;
+ }
+
ps->flags = have; /* should_suppress_msgport looks at them. */
if (should_suppress_msgport (ps))
/* Something is likely to have hosed the msg port, so don't use it. */