remove another invalid skip of locking in ungetwc
[oweals/musl.git] / src / unistd / readlink.c
index f6b1635c631c82ce96c950b0c31434119eacc841..a152d52492ed775d3d8fd57125423e461bfb20d8 100644 (file)
@@ -1,7 +1,12 @@
 #include <unistd.h>
+#include <fcntl.h>
 #include "syscall.h"
 
-int readlink(const char *path, char *buf, size_t bufsize)
+ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
 {
-       return syscall3(__NR_readlink, (long)path, (long)buf, bufsize);
+#ifdef SYS_readlink
+       return syscall(SYS_readlink, path, buf, bufsize);
+#else
+       return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
+#endif
 }