syscalls: unlinkat

This commit is contained in:
Matheus
2023-07-05 00:36:29 -03:00
parent 9d9e5b288d
commit 54e85957cf
4 changed files with 95 additions and 7 deletions
+10 -4
View File
@@ -133,10 +133,10 @@ index 0000000..e5b087a
+
diff --git mlibc-workdir/sysdeps/astral/generic/generic.cpp mlibc-workdir/sysdeps/astral/generic/generic.cpp
new file mode 100644
index 0000000..f931e99
index 0000000..f72940e
--- /dev/null
+++ mlibc-workdir/sysdeps/astral/generic/generic.cpp
@@ -0,0 +1,255 @@
@@ -0,0 +1,260 @@
+#include <bits/ensure.h>
+#include <mlibc/debug.hpp>
+#include <mlibc/all-sysdeps.hpp>
@@ -192,6 +192,11 @@ index 0000000..f931e99
+ return 0;
+ }
+
+ int sys_unlinkat(int fd, const char *path, int flags) {
+ long ret;
+ return syscall(SYSCALL_UNLINKAT, &ret, fd, (uint64_t)path, flags);
+ }
+
+ int sys_faccessat(int dirfd, const char *pathname, int mode, int flags){
+ long ret;
+ return syscall(SYSCALL_FACCESSAT, &ret, dirfd, (uint64_t)pathname, mode, flags);
@@ -411,10 +416,10 @@ index 0000000..990eca0
+#endif
diff --git mlibc-workdir/sysdeps/astral/include/astral/syscall.h mlibc-workdir/sysdeps/astral/include/astral/syscall.h
new file mode 100644
index 0000000..3a71f84
index 0000000..89e809e
--- /dev/null
+++ mlibc-workdir/sysdeps/astral/include/astral/syscall.h
@@ -0,0 +1,48 @@
@@ -0,0 +1,49 @@
+#ifndef _SYSCALL_H_INCLUDE
+#define _SYSCALL_H_INCLUDE
+
@@ -443,6 +448,7 @@ index 0000000..3a71f84
+#define SYSCALL_PIPE2 22
+#define SYSCALL_ISATTY 23
+#define SYSCALL_FACCESSAT 24
+#define SYSCALL_UNLINKAT 25
+
+#include <stddef.h>
+#include <stdint.h>