Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
@@ -914,6 +914,7 @@ extern int symlinkat (const char *__from, int __tofd,
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
char *__restrict __buf, size_t __len)
__THROW __nonnull ((2, 3)) __wur;
+libc_hidden_proto(readlinkat)
#endif
/* Remove the link NAME. */
@@ -10,5 +10,13 @@
#include <sys/syscall.h>
#include <unistd.h>
+#if defined(__NR_readlinkat) && !defined(__NR_readlink)
+# include <fcntl.h>
+ssize_t readlink (const char *path, char *buf, size_t len)
+{
+ return readlinkat(AT_FDCWD, path, buf, len);
+}
+#else
_syscall3(ssize_t, readlink, const char *, path, char *, buf, size_t, bufsiz)
+#endif
libc_hidden_def(readlink)
@@ -11,6 +11,7 @@
#ifdef __NR_readlinkat
_syscall4(ssize_t, readlinkat, int, fd, const char *, path, char *, buf, size_t, len)
+libc_hidden_def(readlinkat)
#else
/* should add emulation with readlink() and /proc/self/fd/ ... */