From be9be179a2cde041fbe042362ee80f9874233953 Mon Sep 17 00:00:00 2001 From: antrik Date: Sat, 20 Jun 2009 12:29:06 +0200 Subject: Obtain number of ports in proc and libps Add (and implement) a proc RPC to obtain the number of Mach ports used by the target task. Add infrastructure in libps to read this information. * hurd/process.defs (proc_getnports): New RPC. * hurd/process_request.defs (proc_getnports_request): New RPC. * libps/procstat.c (proc_stat_set_flags): Call proc_getnports RPC if needed. * libps/ps.h (proc_stat): New `num_ports' field. (PSTAT_NUM_PORTS): New macro. (proc_stat_num_ports): New macro. * libps/spec.c (ps_get_num_ports): New function. (ps_num_ports_getter): New variable. (specs): New entry for `ps_num_ports_getter'. * proc/info.c (S_proc_getnports): New function. --- hurd/process.defs | 8 +++++++- hurd/process_request.defs | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'hurd') diff --git a/hurd/process.defs b/hurd/process.defs index a87cc421..43cc9f2a 100644 --- a/hurd/process.defs +++ b/hurd/process.defs @@ -356,7 +356,7 @@ routine proc_getpgrppids ( out pidset: pidarray_t, dealloc); -/*** Another miscelleneous info query ***/ +/*** Other miscelleneous info queries ***/ /* Return the controlling TTY used by PID in TTY; opened without read or write access. */ @@ -364,3 +364,9 @@ routine proc_get_tty ( calling_process: process_t; target_process: pid_t; out tty: mach_port_send_t); + +/* Return the number of Mach ports used by PID */ +routine proc_getnports ( + process: process_t; + which: pid_t; + out nports: mach_msg_type_number_t); diff --git a/hurd/process_request.defs b/hurd/process_request.defs index 8669e443..80a28282 100644 --- a/hurd/process_request.defs +++ b/hurd/process_request.defs @@ -365,3 +365,9 @@ simpleroutine proc_get_tty_request ( process: process_t; ureplyport reply: reply_port_t; pid: pid_t); + +/* Return the number of Mach ports used by PID */ +simpleroutine proc_getnports_request ( + process: process_t; + ureplyport reply: reply_port_t; + which: pid_t); -- cgit v1.2.3