aboutsummaryrefslogtreecommitdiff
path: root/libps/ps.h
diff options
context:
space:
mode:
Diffstat (limited to 'libps/ps.h')
-rw-r--r--libps/ps.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libps/ps.h b/libps/ps.h
index 27f2e787..b85ede46 100644
--- a/libps/ps.h
+++ b/libps/ps.h
@@ -261,6 +261,8 @@ struct proc_stat
/* Virtual memory statistics for the process, as returned by task_info;
see <mach/task_info.h> for a description of task_events_info_t. */
+ /* FIXME: we are actually currently storing it into proc_info, see
+ fetch_procinfo. */
task_events_info_t task_events_info;
task_events_info_data_t task_events_info_buf;
size_t task_events_info_size;
@@ -301,6 +303,8 @@ struct proc_stat
char *env;
/* The length of ENV. */
size_t env_len;
+
+ unsigned num_ports;
};
/* Proc_stat flag bits; each bit is set in the FLAGS field if that
@@ -338,6 +342,7 @@ struct proc_stat
#define PSTAT_OWNER_UID 0x200000 /* The uid of the the proc's owner */
#define PSTAT_UMASK 0x400000 /* The proc's current umask */
#define PSTAT_HOOK 0x800000 /* Has a non-zero hook */
+#define PSTAT_NUM_PORTS 0x4000000 /* Number of Mach ports in the task */
/* Flag bits that don't correspond precisely to any field. */
#define PSTAT_NO_MSGPORT 0x1000000 /* Don't use the msgport at all */
@@ -441,6 +446,7 @@ extern char *proc_stat_state_tags;
#define proc_stat_umask(ps) ((ps)->umask)
#define proc_stat_tty(ps) ((ps)->tty)
#define proc_stat_task_events_info(ps) ((ps)->task_events_info)
+#define proc_stat_num_ports(ps) ((ps)->num_ports)
#define proc_stat_has(ps, needs) (((ps)->flags & needs) == needs)
/* True if PS refers to a thread and not a process. */
@@ -454,7 +460,9 @@ error_t _proc_stat_create (pid_t pid, struct ps_context *context,
/* Frees PS and any memory/ports it references. Users shouldn't use this
routine; proc_stats are normally freed only when their ps_context goes
- away. */
+ away. Insubordinate users will make sure they free the thread proc_stats
+ before they free the corresponding process proc_stat since the thread_wait
+ fields of the former may reference the latter. */
void _proc_stat_free (struct proc_stat *ps);
/* Adds FLAGS to PS's flags, fetching information as necessary to validate