summaryrefslogtreecommitdiff
path: root/src/sys/stat/chmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/stat/chmod.c')
-rw-r--r--src/sys/stat/chmod.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sys/stat/chmod.c b/src/sys/stat/chmod.c
new file mode 100644
index 00000000..f061e1a8
--- /dev/null
+++ b/src/sys/stat/chmod.c
@@ -0,0 +1,17 @@
+#include "sys/types.h"
+#include <sys/stat.h>
+#include "nonstd/syscall.h"
+
+int chmod(const char *path, mode_t mode)
+{
+ SCNO(scno, "chmod", -1);
+ int r = __libc.syscall(scno, path, mode);
+ if (r < 0) {
+ errno = -r;
+ return -1;
+ }
+ return 0;
+}
+/*
+POSIX(1)
+*/