toaruos/libc/unistd/symlink.c

20 lines
306 B
C
Raw Normal View History

2018-05-21 15:45:18 +03:00
#include <unistd.h>
#include <errno.h>
#include <syscall.h>
#include <syscall_nums.h>
2018-06-04 09:24:53 +03:00
DEFN_SYSCALL2(symlink, SYS_SYMLINK, const char *, const char *);
2018-05-21 15:45:18 +03:00
2018-05-22 02:30:10 +03:00
int symlink(const char *target, const char *name) {
2018-05-21 15:45:18 +03:00
int r = syscall_symlink(target, name);
if (r < 0) {
errno = -r;
return -1;
}
return r;
}