signal.h: add new sa_flags from linux v5.11
[musl.git] / src / unistd / readlinkat.c
blobf79d3d14280ec46afc56dc715f684a1b0cd721e5
1 #include <unistd.h>
2 #include "syscall.h"
4 ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
6 char dummy[1];
7 if (!bufsize) {
8 buf = dummy;
9 bufsize = 1;
11 int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
12 if (buf == dummy && r > 0) r = 0;
13 return __syscall_ret(r);