summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-17 12:49:33 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:14:48 +0200
commit3907bbbcfb806799a5349e46a2b804307a0e9836 (patch)
tree94aac58b745f98a4362f4ba56af83205b08391d2 /main.c
parent56ba0ac1e3a3f32763060ab862a6f0054c8a50bf (diff)
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.
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index 62e440d..bc5c865 100644
--- a/main.c
+++ b/main.c
@@ -1,21 +1,29 @@
#include <mach.h>
+#include <hurd.h>
#include <error.h>
#include <argp.h>
#include <hurd/netfs.h>
#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;