qword: Added unlink
@@ -428,8 +428,18 @@ int sys_readlink(const char *path, void *buffer, size_t max_size, ssize_t *lengt
int sys_ftruncate(int fd, size_t size) STUB_ONLY
int sys_fallocate(int fd, off_t offset, size_t size) STUB_ONLY
int sys_unlink(const char *path) {
- mlibc::infoLogger() << "mlibc: " << __func__ << " is a stub!" << frg::endlog;
- return ENOSYS;
+ int ret;
+ int sys_errno;
+
+ asm volatile ("syscall"
+ : "=a"(ret), "=d"(sys_errno)
+ : "a"(34), "D"(path)
+ : "rcx", "r11");
+
+ if (ret == -1)
+ return sys_errno;
+
+ return 0;
}
int sys_symlink(const char *target_path, const char *link_path) STUB_ONLY
int sys_fcntl(int fd, int request, va_list args, int *result) {
