summaryrefslogtreecommitdiff
path: root/src/includes
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2012-01-26 20:44:33 +0100
committerChristian Ruppert <idl0r@gentoo.org>2012-01-26 20:46:31 +0100
commit44019f6542885fd684c5113c7a5c06308a51102a (patch)
tree9894e04ea8c2f3707bd0de54973d8f279451f4fe /src/includes
parentde5cee2c217e5ed606db19ca1433686048303297 (diff)
downloadopenrc-44019f6542885fd684c5113c7a5c06308a51102a.tar.gz
openrc-44019f6542885fd684c5113c7a5c06308a51102a.tar.bz2
openrc-44019f6542885fd684c5113c7a5c06308a51102a.tar.xz
Add is_writable() function to check whether a path is writable or not
Diffstat (limited to 'src/includes')
-rw-r--r--src/includes/rc-misc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h
index 773c4b9..18ed5b9 100644
--- a/src/includes/rc-misc.h
+++ b/src/includes/rc-misc.h
@@ -36,6 +36,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#define RC_LEVEL_BOOT "boot"
#define RC_LEVEL_DEFAULT "default"
@@ -166,6 +167,12 @@ int svc_lock(const char *);
int svc_unlock(const char *, int);
pid_t exec_service(const char *, const char *);
+/*
+ * Check whether path is writable or not,
+ * this also works properly with read-only filesystems
+ */
+int is_writable(const char *);
+
#define service_start(service) exec_service(service, "start");
#define service_stop(service) exec_service(service, "stop");