syscalls: readv writev

This commit is contained in:
Matheus
2025-11-04 02:04:11 -03:00
parent 2bafdee791
commit 5d79c7840d
5 changed files with 169 additions and 7 deletions
+20 -4
View File
@@ -281,13 +281,27 @@ index b2db152..e6438fe 100644
linker.linkObjects(object);
linker.initObjects(initialRepository.get());
diff --git mlibc-clean/sysdeps/astral/generic/generic.cpp mlibc-workdir/sysdeps/astral/generic/generic.cpp
index be7ad9e..6fb09ec 100644
index be7ad9e..80cc8d9 100644
--- mlibc-clean/sysdeps/astral/generic/generic.cpp
+++ mlibc-workdir/sysdeps/astral/generic/generic.cpp
@@ -47,6 +47,11 @@ namespace mlibc {
@@ -47,6 +47,25 @@ namespace mlibc {
return 0;
}
+ int sys_readv(int fd, const struct iovec *iovs, int iovc, ssize_t *bytes_read) {
+ long r;
+ int error = syscall(SYSCALL_READV, &r, fd, (uint64_t)iovs, iovc);
+ *bytes_read = r;
+ return error;
+ }
+
+ int sys_writev(int fd, const struct iovec *iovs, int iovc, ssize_t *bytes_written) {
+ long r;
+ int error = syscall(SYSCALL_WRITEV, &r, fd, (uint64_t)iovs, iovc);
+ *bytes_written = r;
+ return error;
+ }
+
+ int sys_sysinfo(struct sysinfo *info) {
+ long r;
+ return syscall(SYSCALL_SYSINFO, &r, (uint64_t)info);
@@ -297,14 +311,16 @@ index be7ad9e..6fb09ec 100644
long ret;
// can never fail
diff --git mlibc-clean/sysdeps/astral/include/astral/syscall.h mlibc-workdir/sysdeps/astral/include/astral/syscall.h
index 8414286..9773b9c 100644
index 8414286..a6c4067 100644
--- mlibc-clean/sysdeps/astral/include/astral/syscall.h
+++ mlibc-workdir/sysdeps/astral/include/astral/syscall.h
@@ -100,6 +100,7 @@
@@ -100,6 +100,9 @@
#define SYSCALL_NICE 93
#define SYSCALL_FLOCK 94
#define SYSCALL_GETCPU 95
+#define SYSCALL_SYSINFO 96
+#define SYSCALL_WRITEV 97
+#define SYSCALL_READV 98
#ifndef __MLIBC_ABI_ONLY