summaryrefslogtreecommitdiff
path: root/procfs_dir.c
AgeCommit message (Collapse)Author
2010-08-30Add the dot entries to directoriesJeremie Koenig
* procfs_dir.c (procfs_dir_get_contents): Prepend the . and .. entries to the ones from the given table.
2010-08-30More cleanup possibilitiesJeremie Koenig
* procfs.c, procfs.h: Extend the signature of the cleanup_contents callback in the procfs_node_ops structure to include the hook and contents_len. (cleanup_contents_with_free, cleanup_contents_with_vm_deallocate): New functions, can be used as a cleanup_contents callback for simple cases. * procfs_dir.c, procfs_dir.h (procfs_dir_make_node): Update, add a cleanup callback, make sure the cleanup callback is invoked if there is an error. * proclist.c (proclist_make_node), main.c (main): Update to match the new interfaces.
2010-08-30Fix the failure semantics of procfs_make_nodeJeremie Koenig
* procfs.c (procfs_make_node): Invoke the cleanup callback on failure, so that callers don't have to. * procfs.h: Document the change. * procfs_dir.c (procfs_dir_make_node), procfs_file.c (procfs_file_make_node), proclist.c (proclist_make_node): Update to reflect the change.
2010-08-30Implement simple directoriesJeremie Koenig
* procfs_dir.h: New file; declare the procfs_dir_make_node function, based on the procfs_dir_entry structure. * procfs_dir.c: New file; implement simple directories. * Makefile: Add the procfs_dir module. * main.c: Use it.