X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Funistd%2Freadlink.c;h=a152d52492ed775d3d8fd57125423e461bfb20d8;hb=4554f155dd23a65fcdfd39f1d5af8af55ba37694;hp=f6b1635c631c82ce96c950b0c31434119eacc841;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c index f6b1635c..a152d524 100644 --- a/src/unistd/readlink.c +++ b/src/unistd/readlink.c @@ -1,7 +1,12 @@ #include +#include #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 }