1
- From 9a74ab891ad2f1e2c47ef495767e5b3a25c33fa2 Mon Sep 17 00:00:00 2001
1
+ From 3f789791be46cefe9ff8a5c6196a3a23bed9620f Mon Sep 17 00:00:00 2001
2
2
From: Andy-Python-Programmer <
[email protected] >
3
3
Date: Sun, 16 Apr 2023 14:21:09 +1000
4
4
Subject: [PATCH] <xxx>
5
5
6
6
Signed-off-by: Andy-Python-Programmer <
[email protected] >
7
7
---
8
8
.gitignore | 2 ++
9
- options/ansi/generic/stdlib-stubs.cpp | 6 ++++ --
10
- options/glibc/generic/execinfo.cpp | 5 +++ --
9
+ options/ansi/generic/stdlib-stubs.cpp | 6 +++--
10
+ options/glibc/generic/execinfo.cpp | 5 ++--
11
11
options/rtdl/generic/linker.cpp | 2 +-
12
- sysdeps/aero/generic/aero.cpp | 27 +++++++++++++++++- -------
13
- sysdeps/aero/generic/filesystem.cpp | 14 +++++++------
14
- sysdeps/aero/generic/sockets.cpp | 29 +++++++++++++++++++++++++ --
15
- sysdeps/aero/include/aero/syscall.h | 10 +++++++++
16
- 8 files changed, 74 insertions(+), 21 deletions(-)
12
+ sysdeps/aero/generic/aero.cpp | 27 +++++++++++++++-------
13
+ sysdeps/aero/generic/filesystem.cpp | 33 ++++++++++++++------- ------
14
+ sysdeps/aero/generic/sockets.cpp | 29 +++++++++++++++++++++--
15
+ sysdeps/aero/include/aero/syscall.h | 10 ++++++++
16
+ 8 files changed, 83 insertions(+), 31 deletions(-)
17
17
18
18
diff --git a/.gitignore b/.gitignore
19
19
index fdd60a0..9f811f4 100644
@@ -125,7 +125,7 @@ index 6eeb980..e6bd277 100644
125
125
}
126
126
127
127
diff --git a/sysdeps/aero/generic/filesystem.cpp b/sysdeps/aero/generic/filesystem.cpp
128
- index a2c483b..5332f22 100644
128
+ index a2c483b..fa5a369 100644
129
129
--- a/sysdeps/aero/generic/filesystem.cpp
130
130
+++ b/sysdeps/aero/generic/filesystem.cpp
131
131
@@ -155,14 +155,16 @@ int sys_tcgetattr(int fd, struct termios *attr) {
@@ -151,6 +151,40 @@ index a2c483b..5332f22 100644
151
151
return e;
152
152
153
153
return 0;
154
+ @@ -178,9 +180,7 @@ int sys_mkdir(const char *path, mode_t) {
155
+ return 0;
156
+ }
157
+
158
+ - int sys_rmdir(const char *path) UNIMPLEMENTED("sys_rmdir")
159
+ -
160
+ - int sys_link(const char *srcpath, const char *destpath) {
161
+ + int sys_link(const char *srcpath, const char *destpath) {
162
+ auto result =
163
+ syscall(SYS_LINK, srcpath, strlen(srcpath), destpath, strlen(destpath));
164
+
165
+ @@ -191,14 +191,15 @@ int sys_rmdir(const char *path) UNIMPLEMENTED("sys_rmdir")
166
+ return 0;
167
+ }
168
+
169
+ - int sys_unlinkat(int fd, const char *path, int flags) {
170
+ - auto result = syscall(SYS_UNLINK, fd, path, strlen(path), flags);
171
+ -
172
+ - if (result < 0) {
173
+ - return -result;
174
+ - }
175
+ + int sys_rmdir(const char *path) {
176
+ + return sys_unlinkat(AT_FDCWD, path, AT_REMOVEDIR);
177
+ + }
178
+
179
+ - return 0;
180
+ + int sys_unlinkat(int fd, const char *path, int flags) {
181
+ + auto ret = syscall(SYS_UNLINK, fd, path, strlen(path), flags);
182
+ + if (int e = sc_error(ret); e)
183
+ + return e;
184
+ + return 0;
185
+ }
186
+
187
+ struct aero_dir_entry {
154
188
diff --git a/sysdeps/aero/generic/sockets.cpp b/sysdeps/aero/generic/sockets.cpp
155
189
index 4db9956..4cb3ee8 100644
156
190
--- a/sysdeps/aero/generic/sockets.cpp
@@ -228,5 +262,5 @@ index aa642e5..d8bf99e 100644
228
262
+ }
229
263
#endif // SYSCALL_H
230
264
- -
231
- 2.40.0
265
+ 2.40.1
232
266
0 commit comments