Signed-off-by: Jonas Bonn <[email protected]>
---
 libc/sysdeps/linux/common/lchown.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/lchown.c 
b/libc/sysdeps/linux/common/lchown.c
index c0f8ce7..c1103a6 100644
--- a/libc/sysdeps/linux/common/lchown.c
+++ b/libc/sysdeps/linux/common/lchown.c
@@ -10,6 +10,15 @@
 #include <sys/syscall.h>
 #include <unistd.h>
 #include <bits/wordsize.h>
+#include <fcntl.h>
+
+#ifdef __NR_fchownat
+int lchown(const char *path, uid_t owner, gid_t group)
+{
+       return fchownat(AT_FDCWD, path, owner, group, AT_SYMLINK_NOFOLLOW);
+}
+
+#else
 
 #if (__WORDSIZE == 32 && defined(__NR_lchown32)) || __WORDSIZE == 64
 # ifdef __NR_lchown32
@@ -36,3 +45,5 @@ int lchown(const char *path, uid_t owner, gid_t group)
 }
 
 #endif
+
+#endif
-- 
1.7.5.4

_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to