1- From d3bcf4e954ce27b14f5ffdb994486c984d1773ad Mon Sep 17 00:00:00 2001
1+ From a1c97a1acc4f67a2add919e2dbf8a7f35d1a107a Mon Sep 17 00:00:00 2001
22From: Matt Taylor <mstaveleytaylor@gmail.com>
33Date: Fri, 17 Jun 2022 15:28:34 +0100
44Subject: [PATCH] abi-bits: add domainname to utsname
@@ -10,8 +10,9 @@ Subject: [PATCH] abi-bits: add domainname to utsname
1010 options/glibc/generic/execinfo.cpp | 6 +-
1111 options/rtdl/generic/linker.cpp | 2 +-
1212 sysdeps/aero/generic/aero.cpp | 10 ++-
13- sysdeps/aero/include/aero/syscall.h | 1 +
14- 7 files changed, 104 insertions(+), 17 deletions(-)
13+ sysdeps/aero/generic/filesystem.cpp | 19 ++++-
14+ sysdeps/aero/include/aero/syscall.h | 2 +
15+ 8 files changed, 122 insertions(+), 19 deletions(-)
1516
1617diff --git a/ABI_BREAKS.md b/ABI_BREAKS.md
1718index 0cd3993b..d2a0bb7d 100644
@@ -204,15 +205,49 @@ index 43ddb906..f4fe182f 100644
204205 int sys_seteuid(uid_t euid) UNIMPLEMENTED("sys_seteuid")
205206
206207 gid_t sys_getgid() {
208+ diff --git a/sysdeps/aero/generic/filesystem.cpp b/sysdeps/aero/generic/filesystem.cpp
209+ index a3e2aca2..a56438f0 100644
210+ --- a/sysdeps/aero/generic/filesystem.cpp
211+ +++ b/sysdeps/aero/generic/filesystem.cpp
212+ @@ -158,11 +158,26 @@ int sys_tcsetattr(int fd, int optional_action, const struct termios *attr) {
213+ return 0;
214+ }
215+
216+ - int sys_poll(struct pollfd *fds, nfds_t count, int timeout, int *num_events) {
217+ - mlibc::infoLogger() << "sys_poll() is not implemented" << frg::endlog;
218+ + int sys_ppoll(struct pollfd *fds, int nfds, const struct timespec *timeout,
219+ + const sigset_t *sigmask, int *num_events) {
220+ + auto result = syscall(SYS_POLL, fds, nfds, timeout, sigmask);
221+ +
222+ + if (result < 0) {
223+ + return -result;
224+ + }
225+ +
226+ + *num_events = result;
227+ return 0;
228+ }
229+
230+ + int sys_poll(struct pollfd *fds, nfds_t count, int timeout, int *num_events) {
231+ + struct timespec ts;
232+ + ts.tv_sec = timeout / 1000;
233+ + ts.tv_nsec = (timeout % 1000) * 1000000;
234+ +
235+ + return sys_ppoll(fds, count, &ts, NULL, num_events);
236+ + }
237+ +
238+ int sys_mkdir(const char *path, mode_t) {
239+ auto result = syscall(SYS_MKDIR, path, strlen(path));
240+
207241diff --git a/sysdeps/aero/include/aero/syscall.h b/sysdeps/aero/include/aero/syscall.h
208- index 12f8dc61..cf57bd3d 100644
242+ index 12f8dc61..fcc219a9 100644
209243--- a/sysdeps/aero/include/aero/syscall.h
210244+++ b/sysdeps/aero/include/aero/syscall.h
211- @@ -64,6 +64,7 @@
245+ @@ -64,6 +64,8 @@
212246 #define SYS_FUTEX_WAIT 57
213247 #define SYS_FUTEX_WAKE 58
214248 #define SYS_LINK 59
215249+ #define SYS_BACKTRACE 60
250+ + #define SYS_POLL 61
216251
217252 // Invalid syscall used to trigger a log error in the kernel (as a hint)
218253 // so, that we can implement the syscall in the kernel.
0 commit comments