summaryrefslogtreecommitdiffstats
path: root/usr/klibc/chown.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/chown.c')
-rw-r--r--usr/klibc/chown.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr/klibc/chown.c b/usr/klibc/chown.c
new file mode 100644
index 0000000..089cfc5
--- /dev/null
+++ b/usr/klibc/chown.c
@@ -0,0 +1,12 @@
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifndef __NR_chown
+
+int chown(const char *path, uid_t owner, gid_t group)
+{
+ return fchownat(AT_FDCWD, path, owner, group, 0);
+}
+
+#endif /* __NR_chown */