@@ -102,11 +102,32 @@ index 0000000..1b61d5a
102
102
+ ret
103
103
+ .section .note.GNU-stack,"",%progbits
104
104
diff --git mlibc-clean/sysdeps/aero/generic/filesystem.cpp mlibc-workdir/sysdeps/aero/generic/filesystem.cpp
105
- index 33a11f4..fe5773d 100644
105
+ index 33a11f4..987dc8e 100644
106
106
--- mlibc-clean/sysdeps/aero/generic/filesystem.cpp
107
107
+++ mlibc-workdir/sysdeps/aero/generic/filesystem.cpp
108
- @@ -102,31 +102,24 @@ int sys_access(const char *filename, int mode) {
108
+ @@ -89,44 +89,38 @@ int sys_close(int fd) {
109
+ return 0;
110
+ }
111
+
112
+ - int sys_access(const char *filename, int mode) {
113
+ - auto result =
114
+ - syscall(SYS_ACCESS, AT_FDCWD, filename, strlen(filename), mode, 0);
115
+ -
116
+ - if (result < 0) {
117
+ - return -result;
118
+ - }
119
+ -
120
+ + int sys_faccessat(int dirfd, const char *pathname, int mode, int flags) {
121
+ + auto ret = syscall(SYS_ACCESS, dirfd, pathname, strlen(pathname), mode, flags);
122
+ + if(int e = sc_error(ret); e)
123
+ + return e;
124
+ return 0;
125
+ }
109
126
127
+ + int sys_access(const char *filename, int mode) {
128
+ + return sys_faccessat(AT_FDCWD, filename, mode, 0);
129
+ + }
130
+ +
110
131
int sys_stat(fsfd_target fsfdt, int fd, const char *path, int flags,
111
132
struct stat *statbuf) {
112
133
- auto result = 0;
@@ -118,7 +139,7 @@ index 33a11f4..fe5773d 100644
118
139
+ fd = AT_FDCWD;
119
140
break;
120
141
- }
121
- -
142
+
122
143
- case fsfd_target::fd: {
123
144
- result = syscall(SYS_FSTAT, fd, statbuf);
124
145
+ case fsfd_target::fd:
@@ -149,7 +170,7 @@ index 33a11f4..fe5773d 100644
149
170
return 0;
150
171
}
151
172
152
- @@ -212,6 +205 ,17 @@ int sys_unlinkat(int fd, const char *path, int flags) {
173
+ @@ -212,6 +206 ,17 @@ int sys_unlinkat(int fd, const char *path, int flags) {
153
174
return 0;
154
175
}
155
176
0 commit comments