1
- From 9591f4a8fe0242eafb16c5816455f1d763b19b77 Mon Sep 17 00:00:00 2001
1
+ From adcc64e89eb5e570e6ad2bc578fd8b891ee6bd9a Mon Sep 17 00:00:00 2001
2
2
From: Andy-Python-Programmer <
[email protected] >
3
- Date: Wed, 1 Feb 2023 16:53:35 +1100
3
+ Date: Fri, 17 Feb 2023 19:21:05 +1100
4
4
Subject: [PATCH] <xxx>
5
5
6
6
---
@@ -10,12 +10,12 @@ Subject: [PATCH] <xxx>
10
10
options/posix/generic/dlfcn-stubs.cpp | 1 +
11
11
options/rtdl/generic/linker.cpp | 2 +-
12
12
sysdeps/aero/generic/aero.cpp | 69 ++++++----
13
- sysdeps/aero/generic/filesystem.cpp | 35 ++++-
13
+ sysdeps/aero/generic/filesystem.cpp | 51 ++ ++++-
14
14
sysdeps/aero/generic/sockets.cpp | 87 +++++++++++-
15
15
sysdeps/aero/generic/time.cpp | 24 ++++
16
16
sysdeps/aero/include/aero/syscall.h | 9 ++
17
17
sysdeps/aero/meson.build | 1 +
18
- 11 files changed, 374 insertions(+), 46 deletions(-)
18
+ 11 files changed, 389 insertions(+), 47 deletions(-)
19
19
create mode 100644 sysdeps/aero/generic/time.cpp
20
20
21
21
diff --git a/.gitignore b/.gitignore
@@ -269,7 +269,7 @@ index fc9fd84..ab57631 100644
269
269
return __dlapi_open(file, flags, ra);
270
270
}
271
271
diff --git a/options/rtdl/generic/linker.cpp b/options/rtdl/generic/linker.cpp
272
- index 2e2d3f1..3ff5fef 100644
272
+ index 6eb9d09..2ab5bc9 100644
273
273
--- a/options/rtdl/generic/linker.cpp
274
274
+++ b/options/rtdl/generic/linker.cpp
275
275
@@ -18,7 +18,7 @@ uintptr_t libraryBase = 0x41000000;
@@ -412,10 +412,20 @@ index 29fb961..b5945a8 100644
412
412
}
413
413
414
414
diff --git a/sysdeps/aero/generic/filesystem.cpp b/sysdeps/aero/generic/filesystem.cpp
415
- index a3e2aca..a4edac3 100644
415
+ index a3e2aca..8a1e086 100644
416
416
--- a/sysdeps/aero/generic/filesystem.cpp
417
417
+++ b/sysdeps/aero/generic/filesystem.cpp
418
- @@ -158,11 +158,6 @@ int sys_tcsetattr(int fd, int optional_action, const struct termios *attr) {
418
+ @@ -118,7 +118,8 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result) {
419
+ return -sys_res;
420
+ }
421
+
422
+ - *result = sys_res;
423
+ + if (result)
424
+ + *result = sys_res;
425
+ return 0;
426
+ }
427
+
428
+ @@ -158,11 +159,6 @@ int sys_tcsetattr(int fd, int optional_action, const struct termios *attr) {
419
429
return 0;
420
430
}
421
431
@@ -427,7 +437,7 @@ index a3e2aca..a4edac3 100644
427
437
int sys_mkdir(const char *path, mode_t) {
428
438
auto result = syscall(SYS_MKDIR, path, strlen(path));
429
439
430
- @@ -243,7 +238 ,15 @@ int sys_open_dir(const char *path, int *handle) {
440
+ @@ -243,7 +239 ,15 @@ int sys_open_dir(const char *path, int *handle) {
431
441
return sys_open(path, O_DIRECTORY, 0, handle);
432
442
}
433
443
@@ -444,7 +454,7 @@ index a3e2aca..a4edac3 100644
444
454
445
455
int sys_readlink(const char *path, void *buffer, size_t max_size, ssize_t *length) {
446
456
auto result = syscall(SYS_READ_LINK, path, strlen(path), buffer, max_size);
447
- @@ -357,4 +360,24 @@ int sys_eventfd_create(unsigned int initval, int flags, int *fd) {
457
+ @@ -357,4 +361,37 @@ int sys_eventfd_create(unsigned int initval, int flags, int *fd) {
448
458
*fd = result;
449
459
return 0;
450
460
}
@@ -468,6 +478,19 @@ index a3e2aca..a4edac3 100644
468
478
+
469
479
+ return sys_ppoll(fds, count, &ts, NULL, num_events);
470
480
+ }
481
+ +
482
+ + #ifndef MLIBC_BUILDING_RTDL
483
+ + #include <stdio.h>
484
+ + int sys_ptsname(int fd, char *buffer, size_t length) {
485
+ + int index;
486
+ + if(int e = sys_ioctl(fd, TIOCGPTN, &index, NULL); e)
487
+ + return e;
488
+ + if((size_t)snprintf(buffer, length, "/dev/pts/%d", index) >= length) {
489
+ + return ERANGE;
490
+ + }
491
+ + return 0;
492
+ + }
493
+ + #endif
471
494
} // namespace mlibc
472
495
diff --git a/sysdeps/aero/generic/sockets.cpp b/sysdeps/aero/generic/sockets.cpp
473
496
index b6b18fe..b4635df 100644
0 commit comments