support linux kernel apis (new archs) with old syscalls removed
[musl] / src / unistd / lchown.c
index de871ae..ccd5ee0 100644 (file)
@@ -1,7 +1,12 @@
 #include <unistd.h>
+#include <fcntl.h>
 #include "syscall.h"
 
 int lchown(const char *path, uid_t uid, gid_t gid)
 {
+#ifdef SYS_lchown
        return syscall(SYS_lchown, path, uid, gid);
+#else
+       return syscall(SYS_fchownat, AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW);
+#endif
 }