diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-25 19:04:24 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 15:03:28 +0200 |
commit | 0f3c9c2640ffd76f1d60f16dce6d16c47aac98b4 (patch) | |
tree | 8168f840d92bd2d2ad07b1af063fab1a7450475b /rootdir.c | |
parent | 164db73bb35173f45a7eaba1984c3169cba778e8 (diff) | |
download | hurd-0f3c9c2640ffd76f1d60f16dce6d16c47aac98b4.tar.gz hurd-0f3c9c2640ffd76f1d60f16dce6d16c47aac98b4.tar.bz2 hurd-0f3c9c2640ffd76f1d60f16dce6d16c47aac98b4.zip |
Add some comments in rootdir.c
* rootdir.c: Add page breaks to separate sections and add header
comments for them.
Diffstat (limited to 'rootdir.c')
-rw-r--r-- | rootdir.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -21,6 +21,9 @@ #define KERNEL_PID 2 + +/* Helper functions */ + /* We get the boot time by using that of the kernel process. */ static error_t get_boottime (struct ps_context *pc, struct timeval *tv) @@ -120,6 +123,9 @@ get_swapinfo (default_pager_info_t *info) return err; } + +/* Content generators */ + static error_t rootdir_gc_version (void *hook, char **contents, ssize_t *contents_len) { @@ -137,8 +143,6 @@ rootdir_gc_version (void *hook, char **contents, ssize_t *contents_len) return 0; } -/* Uptime -- we use the start time of init to deduce it. This is probably a bit - fragile, as any clock update will make the result inaccurate. */ static error_t rootdir_gc_uptime (void *hook, char **contents, ssize_t *contents_len) { @@ -373,10 +377,16 @@ rootdir_gc_fakeself (void *hook, char **contents, ssize_t *contents_len) return 0; } + +/* Glue logic and entries table */ static struct node * rootdir_file_make_node (void *dir_hook, const void *entry_hook) { + /* The entry hook we use is actually a procfs_node_ops for the file to be + created. The hook associated to these newly created files (and passed + to the generators above as a consequence) is always the same global + ps_context, which we get from rootdir_make_node as the directory hook. */ return procfs_make_node (entry_hook, dir_hook); } |