diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-17 12:49:33 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:14:48 +0200 |
commit | 3907bbbcfb806799a5349e46a2b804307a0e9836 (patch) | |
tree | 94aac58b745f98a4362f4ba56af83205b08391d2 /main.c | |
parent | 56ba0ac1e3a3f32763060ab862a6f0054c8a50bf (diff) | |
download | hurd-3907bbbcfb806799a5349e46a2b804307a0e9836.tar.gz hurd-3907bbbcfb806799a5349e46a2b804307a0e9836.tar.bz2 hurd-3907bbbcfb806799a5349e46a2b804307a0e9836.zip |
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |