Signed-off-by: Jonas Bonn <[email protected]>
---
libc/sysdeps/linux/common/chown.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/libc/sysdeps/linux/common/chown.c
b/libc/sysdeps/linux/common/chown.c
index f2c60e0..033532f 100644
--- a/libc/sysdeps/linux/common/chown.c
+++ b/libc/sysdeps/linux/common/chown.c
@@ -8,9 +8,17 @@
*/
#include <sys/syscall.h>
+#include <fcntl.h>
#include <unistd.h>
#include <bits/wordsize.h>
+#ifdef __NR_fchownat
+int chown(const char *path, uid_t owner, gid_t group)
+{
+ return fchownat(AT_FDCWD, path, owner, group, 0);
+}
+
+#else
#if (__WORDSIZE == 32 && defined(__NR_chown32)) || __WORDSIZE == 64
# ifdef __NR_chown32
@@ -34,7 +42,8 @@ int chown(const char *path, uid_t owner, gid_t group)
return -1;
}
return (__syscall_chown(path, owner, group));
-}
+#endif
+
#endif
libc_hidden_def(chown)
--
1.7.5.4
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc