1- From 2167f1570f20a986de9b3c81636d78e4ef1cedb8 Mon Sep 17 00:00:00 2001
1+ From 0eb5403c389aaa7144d6bea297aac57d442bc9f6 Mon Sep 17 00:00:00 2001
22From: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
33Date: Fri, 8 Jul 2022 12:32:32 +1000
44Subject: [PATCH] yes
@@ -12,8 +12,11 @@ Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
1212 sysdeps/aero/generic/aero.cpp | 38 +++----
1313 sysdeps/aero/generic/filesystem.cpp | 25 ++++-
1414 sysdeps/aero/generic/sockets.cpp | 77 +++++++++++++-
15- sysdeps/aero/include/aero/syscall.h | 4 +
16- 8 files changed, 241 insertions(+), 54 deletions(-)
15+ sysdeps/aero/generic/time.cpp | 24 +++++
16+ sysdeps/aero/include/aero/syscall.h | 6 ++
17+ sysdeps/aero/meson.build | 1 +
18+ 10 files changed, 268 insertions(+), 54 deletions(-)
19+ create mode 100644 sysdeps/aero/generic/time.cpp
1720
1821diff --git a/.gitignore b/.gitignore
1922index fdd60a00..9f811f47 100644
@@ -425,21 +428,66 @@ index b6b18fe7..e03c634b 100644
425428+ }
426429+ }
427430 } // namespace mlibc
431+ diff --git a/sysdeps/aero/generic/time.cpp b/sysdeps/aero/generic/time.cpp
432+ new file mode 100644
433+ index 00000000..460412d0
434+ --- /dev/null
435+ +++ b/sysdeps/aero/generic/time.cpp
436+ @@ -0,0 +1,24 @@
437+ + #include <mlibc/all-sysdeps.hpp>
438+ + #include <aero/syscall.h>
439+ +
440+ + namespace mlibc {
441+ + int sys_setitimer(int which, const struct itimerval *new_value, struct itimerval *old_value) {
442+ + auto result = syscall(SYS_SETITIMER, which, new_value, old_value);
443+ +
444+ + if (result < 0) {
445+ + return -result;
446+ + }
447+ +
448+ + return 0;
449+ + }
450+ +
451+ + int sys_getitimer(int which, struct itimerval *curr_value) {
452+ + auto result = syscall(SYS_GETITIMER, which, curr_value);
453+ +
454+ + if (result < 0) {
455+ + return -result;
456+ + }
457+ +
458+ + return 0;
459+ + }
460+ + }
461+ \ No newline at end of file
428462diff --git a/sysdeps/aero/include/aero/syscall.h b/sysdeps/aero/include/aero/syscall.h
429- index 12f8dc61..50f8cfa7 100644
463+ index 12f8dc61..03001c46 100644
430464--- a/sysdeps/aero/include/aero/syscall.h
431465+++ b/sysdeps/aero/include/aero/syscall.h
432- @@ -64,6 +64,10 @@
466+ @@ -64,6 +64,12 @@
433467 #define SYS_FUTEX_WAIT 57
434468 #define SYS_FUTEX_WAKE 58
435469 #define SYS_LINK 59
436470+ #define SYS_BACKTRACE 60
437471+ #define SYS_POLL 61
438472+ #define SYS_EXIT_THREAD 62
439473+ #define SYS_SOCK_RECV 63
474+ + #define SYS_SETITIMER 64
475+ + #define SYS_GETITIMER 65
440476
441477 // Invalid syscall used to trigger a log error in the kernel (as a hint)
442478 // so, that we can implement the syscall in the kernel.
479+ diff --git a/sysdeps/aero/meson.build b/sysdeps/aero/meson.build
480+ index 3ca8463e..f1d80139 100644
481+ --- a/sysdeps/aero/meson.build
482+ +++ b/sysdeps/aero/meson.build
483+ @@ -11,6 +11,7 @@ libc_sources += files(
484+ 'generic/filesystem.cpp',
485+ 'generic/sockets.cpp',
486+ 'generic/signals.cpp',
487+ + 'generic/time.cpp',
488+ )
489+
490+ if not no_headers
443491- -
4444922.25.1
445493
0 commit comments