mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
syscalls: readv writev
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user