diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-05-21 17:38:46 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-09-10 23:30:09 +0200 |
commit | 176ec926aec9642768615d5875171c24fb10e6b7 (patch) | |
tree | 9223a684ff222c88dd145ed178817b948c6f8bb5 /utils | |
parent | 75ec1eeaf6a3f08a01471821c9445b9334ff3bd5 (diff) |
utils: implement portinfo --query-process
Implement portinfo --query-process (hopefully) as envisaged by a
comment in portinfo.c. We use the new Hurd server introspection
protocol to obtain information about the objects related to ports:
% utils/portinfo --receive --query-process 5586 77
77: receive [bucket: diskfs_port_bucket, class: diskfs_protid_class,
node{inode: 48194, hard: 1, weak: 1},
path: hello/hurd/developers_:)]
* libshouldbeinlibc/Makefile (OBJS): Add hurd_portUser.o.
* libshouldbeinlibc/portinfo.c (show_portinfo_query): New function.
(print_port_info): Use show_portinfo_query if desired.
* libshouldbeinlibc/portinfo.h (PORTINFO_QUERY): New macro.
* utils/portinfo.c (argp_option): Drop #if 0.
(parse_opt): Handle --query-process.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/portinfo.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/utils/portinfo.c b/utils/portinfo.c index 4c403526..27998db0 100644 --- a/utils/portinfo.c +++ b/utils/portinfo.c @@ -44,10 +44,8 @@ static const struct argp_option options[] = { {"verbose", 'v', 0, 0, "Give more detailed information"}, {"members", 'm', 0, 0, "Show members of port-sets"}, {"hex-names", 'x', 0, 0, "Show port names in hexadecimal"}, -#if 0 /* XXX implement this */ {"query-process", 'q', 0, 0, "Query the process itself for the identity of" " the ports in question -- requires the process be in a sane state"}, -#endif {"hold", '*', 0, OPTION_HIDDEN}, {0,0,0,0, "Selecting which names to show:", 2}, @@ -249,6 +247,7 @@ main (int argc, char **argv) case 'v': show |= PORTINFO_DETAILS; break; case 'm': show |= PORTINFO_MEMBERS; break; case 'x': show |= PORTINFO_HEX_NAMES; break; + case 'q': show |= PORTINFO_QUERY; break; case 'r': only |= MACH_PORT_TYPE_RECEIVE; break; case 's': only |= MACH_PORT_TYPE_SEND; break; |