unistd: readlink syscall is now readlinkat

This commit is contained in:
Mark 2020-10-11 16:29:11 +03:00
parent 0ef6738e26
commit 5aae060742
2 changed files with 4 additions and 12 deletions

View File

@ -1,11 +1,6 @@
#include <ygg/syscall.h>
#include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <fcntl.h>
ssize_t readlink(const char *restrict pathname, char *restrict buf, size_t count) { ssize_t readlink(const char *restrict pathname, char *restrict buf, size_t count) {
(void) pathname; return readlinkat(AT_FDCWD, pathname, buf, count);
(void) buf;
(void) count;
assert(0 && "system call not yet implemented");
} }

View File

@ -1,12 +1,9 @@
#include <ygg/syscall.h> #include <ygg/syscall.h>
#include <_libc/syscalls.h>
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
ssize_t readlinkat(int dfd, const char *restrict pathname, char *restrict buf, size_t count) { ssize_t readlinkat(int dfd, const char *restrict pathname, char *restrict buf, size_t count) {
(void) dfd; return SET_ERRNO(ssize_t, __syscall4(SYSCALL_NR_READLINKAT, dfd, (long) pathname, (long) buf, count));
(void) pathname;
(void) buf;
(void) count;
assert(0 && "system call not yet implemented");
} }