remove another invalid skip of locking in ungetwc
[oweals/musl.git] / src / unistd / lchown.c
index 30e839167f7c3d0f320e1c1d5e70553e7c1186e7..ccd5ee0255eea2af0dcec6f134e21ce07a896faf 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)
 {
-       return syscall3(__NR_lchown32, (long)path, uid, 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
 }