1
- From d1583428ad4f44bb2ca458e06e3a0c60f2c45737 Mon Sep 17 00:00:00 2001
1
+ From 4b435231bee99fa0da6f9498c5342488e02a7bbd Mon Sep 17 00:00:00 2001
2
2
From: Andy-Python-Programmer <
[email protected] >
3
3
Date: Thu, 10 Feb 2022 19:12:25 +1100
4
4
Subject: [PATCH] yes
5
5
6
6
Signed-off-by: Andy-Python-Programmer <
[email protected] >
7
7
---
8
- .gitignore | 7 +++++++
9
- sysdeps/aero/generic/filesystem.cpp | 28 +++++++++++++++++++++- ------
10
- sysdeps/aero/include/aero/syscall.h | 5 +++++
11
- 3 files changed, 33 insertions(+), 7 deletions(-)
8
+ .gitignore | 7 ++++++
9
+ sysdeps/aero/generic/filesystem.cpp | 34 +++++++++++++++++++++++ ------
10
+ sysdeps/aero/include/aero/syscall.h | 6 +++++
11
+ 3 files changed, 40 insertions(+), 7 deletions(-)
12
12
13
13
diff --git a/.gitignore b/.gitignore
14
14
index dbb35e8b..384b3395 100644
@@ -26,10 +26,15 @@ index dbb35e8b..384b3395 100644
26
26
+ # of the project directory.
27
27
+ compile_commands.json
28
28
diff --git a/sysdeps/aero/generic/filesystem.cpp b/sysdeps/aero/generic/filesystem.cpp
29
- index 6a13f19c..ec81503c 100644
29
+ index 6a13f19c..69833ae5 100644
30
30
--- a/sysdeps/aero/generic/filesystem.cpp
31
31
+++ b/sysdeps/aero/generic/filesystem.cpp
32
- @@ -84,9 +84,24 @@ int sys_access(const char *filename, int mode) {
32
+ @@ -1,3 +1,4 @@
33
+ + #include "mlibc/fsfd_target.hpp"
34
+ #include <aero/syscall.h>
35
+
36
+ #include <sys/ioctl.h>
37
+ @@ -84,9 +85,29 @@ int sys_access(const char *filename, int mode) {
33
38
34
39
int sys_stat(fsfd_target fsfdt, int fd, const char *path, int flags,
35
40
struct stat *statbuf) {
@@ -42,6 +47,11 @@ index 6a13f19c..ec81503c 100644
42
47
+ break;
43
48
+ }
44
49
+
50
+ + case fsfd_target::fd: {
51
+ + result = syscall(SYS_FSTAT, fd, statbuf);
52
+ + break;
53
+ + }
54
+ +
45
55
+ default: {
46
56
+ mlibc::infoLogger() << "mlibc warning: sys_stat: unsupported fsfd target" << frg::endlog;
47
57
+ return EINVAL;
@@ -56,7 +66,7 @@ index 6a13f19c..ec81503c 100644
56
66
return 0;
57
67
}
58
68
59
- @@ -192,10 +207 ,10 @@ int sys_read_entries(int handle, void *buffer, size_t max_size,
69
+ @@ -192,10 +213 ,10 @@ int sys_read_entries(int handle, void *buffer, size_t max_size,
60
70
auto entry = (struct aero_dir_entry *)buffer;
61
71
62
72
struct dirent dirent = {
@@ -71,7 +81,7 @@ index 6a13f19c..ec81503c 100644
71
81
};
72
82
73
83
// The reclen is the size of the dirent struct, plus the size of the name.
74
- @@ -252,7 +267 ,6 @@ int sys_pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
84
+ @@ -252,7 +273 ,6 @@ int sys_pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
75
85
const struct timespec *timeout, const sigset_t *sigmask,
76
86
int *num_events) {
77
87
mlibc::infoLogger() << "sys_pselect() is not implemented" << frg::endlog;
@@ -80,10 +90,10 @@ index 6a13f19c..ec81503c 100644
80
90
}
81
91
82
92
diff --git a/sysdeps/aero/include/aero/syscall.h b/sysdeps/aero/include/aero/syscall.h
83
- index 07b1b51b..1e3178d2 100644
93
+ index 07b1b51b..f6d7836d 100644
84
94
--- a/sysdeps/aero/include/aero/syscall.h
85
95
+++ b/sysdeps/aero/include/aero/syscall.h
86
- @@ -49,6 +49,11 @@
96
+ @@ -49,6 +49,12 @@
87
97
#define SYS_DUP 42
88
98
#define SYS_FCNTL 43
89
99
#define SYS_DUP2 44
@@ -92,6 +102,7 @@ index 07b1b51b..1e3178d2 100644
92
102
+ #define SYS_DISCOVER_ROOT 47
93
103
+ #define SYS_BECOME_ROOT 48
94
104
+ #define SYS_STAT 49
105
+ + #define SYS_FSTAT 50
95
106
96
107
// Invalid syscall used to trigger a log error in the kernel (as a hint)
97
108
// so, that we can implement the syscall in the kernel.
0 commit comments