toaruos/libc/unistd/symlink.c
2018-06-04 15:24:53 +09:00

20 lines
306 B
C

#include <unistd.h>
#include <errno.h>
#include <syscall.h>
#include <syscall_nums.h>
DEFN_SYSCALL2(symlink, SYS_SYMLINK, const char *, const char *);
int symlink(const char *target, const char *name) {
int r = syscall_symlink(target, name);
if (r < 0) {
errno = -r;
return -1;
}
return r;
}