summaryrefslogtreecommitdiff
path: root/procfs.h
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-21 11:21:59 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:29:49 +0200
commit75f53efdc66be8c6ffac31bd17a309f9065e273c (patch)
tree434b70dea1f585511be1f9863cdb01bfc2619465 /procfs.h
parenta45606d0036565c468b462a207575bf2b4077fd8 (diff)
Encapsulate access to node->nn_stat
* procfs.c, procfs.h (procfs_node_chown, procfs_node_chmod, procfs_node_chtype): New functions, encapsulate access to some nn_stat fields. * process.c (process_lookup_pid): Use procfs_node_chown instead of direct access.
Diffstat (limited to 'procfs.h')
-rw-r--r--procfs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/procfs.h b/procfs.h
index 4c9d828..4ab3b56 100644
--- a/procfs.h
+++ b/procfs.h
@@ -48,6 +48,19 @@ void procfs_cleanup_contents_with_vm_deallocate (void *, void *, size_t);
enough memory. In this case, ops->cleanup will be invoked. */
struct node *procfs_make_node (const struct procfs_node_ops *ops, void *hook);
+/* Set the owner of the node NP. Must be called right after the node
+ has been created. */
+void procfs_node_chown (struct node *np, uid_t owner);
+
+/* Set the permission bits of the node NP. Must be called right after
+ the node has been created. */
+void procfs_node_chmod (struct node *np, mode_t mode);
+
+/* Set the type of the node NP. If type is S_IFLNK, appropriate
+ permission bits will be set as well. Must be called right after the
+ node has been created. */
+void procfs_node_chtype (struct node *np, mode_t type);
+
/* Interface for the libnetfs side. */