From: Markos Chandras <[email protected]>
Signed-off-by: Markos Chandras <[email protected]>
---
libc/sysdeps/linux/common/lchown.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/libc/sysdeps/linux/common/lchown.c
b/libc/sysdeps/linux/common/lchown.c
index c0f8ce7..25acfa2 100644
--- a/libc/sysdeps/linux/common/lchown.c
+++ b/libc/sysdeps/linux/common/lchown.c
@@ -8,9 +8,18 @@
*/
#include <sys/syscall.h>
+#include <fcntl.h>
#include <unistd.h>
#include <bits/wordsize.h>
+#if defined(__NR_fchownat) && !defined(__NR_lchown)
+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
# undef __NR_lchown
@@ -36,3 +45,5 @@ int lchown(const char *path, uid_t owner, gid_t group)
}
#endif
+
+#endif
--
1.8.0
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc