|
1 |
| -From 2167f1570f20a986de9b3c81636d78e4ef1cedb8 Mon Sep 17 00:00:00 2001 |
| 1 | +From 0eb5403c389aaa7144d6bea297aac57d442bc9f6 Mon Sep 17 00:00:00 2001 |
2 | 2 | From: Andy-Python-Programmer < [email protected]>
|
3 | 3 | Date: Fri, 8 Jul 2022 12:32:32 +1000
|
4 | 4 | Subject: [PATCH] yes
|
|
12 | 12 | sysdeps/aero/generic/aero.cpp | 38 +++----
|
13 | 13 | sysdeps/aero/generic/filesystem.cpp | 25 ++++-
|
14 | 14 | 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 |
17 | 20 |
|
18 | 21 | diff --git a/.gitignore b/.gitignore
|
19 | 22 | index fdd60a00..9f811f47 100644
|
@@ -425,21 +428,66 @@ index b6b18fe7..e03c634b 100644
|
425 | 428 | + }
|
426 | 429 | +}
|
427 | 430 | } // 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 |
428 | 462 | diff --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 |
430 | 464 | --- a/sysdeps/aero/include/aero/syscall.h
|
431 | 465 | +++ b/sysdeps/aero/include/aero/syscall.h
|
432 |
| -@@ -64,6 +64,10 @@ |
| 466 | +@@ -64,6 +64,12 @@ |
433 | 467 | #define SYS_FUTEX_WAIT 57
|
434 | 468 | #define SYS_FUTEX_WAKE 58
|
435 | 469 | #define SYS_LINK 59
|
436 | 470 | +#define SYS_BACKTRACE 60
|
437 | 471 | +#define SYS_POLL 61
|
438 | 472 | +#define SYS_EXIT_THREAD 62
|
439 | 473 | +#define SYS_SOCK_RECV 63
|
| 474 | ++#define SYS_SETITIMER 64 |
| 475 | ++#define SYS_GETITIMER 65 |
440 | 476 |
|
441 | 477 | // Invalid syscall used to trigger a log error in the kernel (as a hint)
|
442 | 478 | // 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 |
443 | 491 | --
|
444 | 492 | 2.25.1
|
445 | 493 |
|
0 commit comments