about summary refs log tree commit diff
path: root/src/unistd/readlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/readlink.c')
-rw-r--r--src/unistd/readlink.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
index ec291e3d..a152d524 100644
--- a/src/unistd/readlink.c
+++ b/src/unistd/readlink.c
@@ -1,7 +1,12 @@
 #include <unistd.h>
+#include <fcntl.h>
 #include "syscall.h"
 
 ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
 {
+#ifdef SYS_readlink
 	return syscall(SYS_readlink, path, buf, bufsize);
+#else
+	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
+#endif
 }