summaryrefslogtreecommitdiff
path: root/src/unistd/chown.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/chown.c')
-rw-r--r--src/unistd/chown.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unistd/chown.c b/src/unistd/chown.c
index 95f6f61e..14b03255 100644
--- a/src/unistd/chown.c
+++ b/src/unistd/chown.c
@@ -1,7 +1,12 @@
#include <unistd.h>
+#include <fcntl.h>
#include "syscall.h"
int chown(const char *path, uid_t uid, gid_t gid)
{
+#ifdef SYS_chown
return syscall(SYS_chown, path, uid, gid);
+#else
+ return syscall(SYS_fchownat, AT_FDCWD, path, uid, gid, 0);
+#endif
}