support linux kernel apis (new archs) with old syscalls removed
[oweals/musl.git] / src / unistd / chown.c
index 95f6f61e9eb1470a997b771e8102d457a55923dd..14b032550d675e6594302a6107c13a599d57443a 100644 (file)
@@ -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
 }