repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
signal.h: add new sa_flags from linux v5.11
[musl.git]
/
src
/
unistd
/
readlinkat.c
blob
f79d3d14280ec46afc56dc715f684a1b0cd721e5
1
#include <unistd.h>
2
#include
"syscall.h"
3
4
ssize_t
readlinkat
(
int
fd
,
const char
*
restrict path
,
char
*
restrict buf
,
size_t
bufsize
)
5
{
6
char
dummy
[
1
];
7
if
(!
bufsize
) {
8
buf
=
dummy
;
9
bufsize
=
1
;
10
}
11
int
r
=
__syscall
(
SYS_readlinkat
,
fd
,
path
,
buf
,
bufsize
);
12
if
(
buf
==
dummy
&&
r
>
0
)
r
=
0
;
13
return
__syscall_ret
(
r
);
14
}