From 3907bbbcfb806799a5349e46a2b804307a0e9836 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Tue, 17 Aug 2010 12:49:33 +0000 Subject: Add the list of processes as a directory * proclist.h, proclist.c: New files. * main.c: Add a proclist directory based on them. * Makefile: Include the proclist module. --- main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 62e440d4..bc5c865c 100644 --- a/main.c +++ b/main.c @@ -1,21 +1,29 @@ #include +#include #include #include #include #include "procfs.h" #include "procfs_file.h" #include "procfs_dir.h" +#include "proclist.h" static struct node *make_file (void *dir_hook, void *ent_hook) { return procfs_file_make_node (ent_hook, -1, NULL); } +static struct node *make_proclist (void *dir_hook, void *ent_hook) +{ + return proclist_make_node (getproc ()); +} + int main (int argc, char **argv) { static const struct procfs_dir_entry entries[] = { { "hello", make_file, "Hello, World!\n" }, { "goodbye", make_file, "Goodbye, cruel World!\n" }, + { "proclist", make_proclist, }, { } }; mach_port_t bootstrap; -- cgit v1.2.3