diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-17 10:10:22 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:14:48 +0200 |
commit | 0a4c7a1ca8bff458eb11322d2c94ec9ffd832524 (patch) | |
tree | 645506d2f687121d88e8012d7d21f68b6de872b0 /procfs_file.h | |
parent | d938e96e59a41d5eaa11040513815b757e58eb0c (diff) | |
download | hurd-0a4c7a1ca8bff458eb11322d2c94ec9ffd832524.tar.gz hurd-0a4c7a1ca8bff458eb11322d2c94ec9ffd832524.tar.bz2 hurd-0a4c7a1ca8bff458eb11322d2c94ec9ffd832524.zip |
Add a helper module for simple regular files
* procfs_file.h: New file, declares procfs_file_make_node.
* procfs_file.c: New file, implements procfs_file_make_node.
* main.c: Use them.
* Makefile: Add the procfs_file module.
Diffstat (limited to 'procfs_file.h')
-rw-r--r-- | procfs_file.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/procfs_file.h b/procfs_file.h new file mode 100644 index 00000000..b615db93 --- /dev/null +++ b/procfs_file.h @@ -0,0 +1,6 @@ +/* Create a new regular file with the given CONTENTS. If LEN is negative, + CONTENTS is considered as a string and the file stops at the first + nul char. If CLEANUP is non-NULL, it is passed CONTENTS when the + node is destroyed. */ +struct node * +procfs_file_make_node (void *contents, ssize_t len, void (*cleanup)(void *)); |