remove another invalid skip of locking in ungetwc
[oweals/musl.git] / src / unistd / readlink.c
index 11f45c01d70286253639bd293e5e7c92d8ed30aa..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)
 {
+#ifdef SYS_readlink
        return syscall(SYS_readlink, path, buf, bufsize);
+#else
+       return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
+#endif
 }