From e0dfe6c32616a8bee77a5c2420c1f2bf6d933696 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 2 May 1995 21:26:12 +0000 Subject: (proc_stat_set_flags, add_preconditions): Add support for the suspend_count field. --- libps/procstat.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libps/procstat.c') 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. */ -- cgit v1.2.3