From 5aae0607428a36d95702c13dc8c9e9b106be42c0 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 11 Oct 2020 16:29:11 +0300 Subject: [PATCH] unistd: readlink syscall is now readlinkat --- src/unistd/readlink.c | 9 ++------- src/unistd/readlinkat.c | 7 ++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c index 94ea0b1..4129836 100644 --- a/src/unistd/readlink.c +++ b/src/unistd/readlink.c @@ -1,11 +1,6 @@ -#include -#include #include -#include +#include ssize_t readlink(const char *restrict pathname, char *restrict buf, size_t count) { - (void) pathname; - (void) buf; - (void) count; - assert(0 && "system call not yet implemented"); + return readlinkat(AT_FDCWD, pathname, buf, count); } diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c index b0ca252..5f4d03b 100644 --- a/src/unistd/readlinkat.c +++ b/src/unistd/readlinkat.c @@ -1,12 +1,9 @@ #include +#include <_libc/syscalls.h> #include #include #include ssize_t readlinkat(int dfd, const char *restrict pathname, char *restrict buf, size_t count) { - (void) dfd; - (void) pathname; - (void) buf; - (void) count; - assert(0 && "system call not yet implemented"); + return SET_ERRNO(ssize_t, __syscall4(SYSCALL_NR_READLINKAT, dfd, (long) pathname, (long) buf, count)); }