feat(uio): readv/writev

This commit is contained in:
2026-09-05 22:51:03 -04:00
parent ea0482e9ff
commit c4156efeff
4 changed files with 449 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <sys/uio.h>
#include "../internal/syscall.h"
/*
* writev: gather write — the kernel writes the iovcnt buffers of iov in
* order and returns the total byte count. The iovec array is passed straight
* to SYS_writev: no argument validation here, the kernel applies its own
* rules (iovcnt 0..IOV_MAX, iov NULL with iovcnt > 0 faults as EFAULT). The
* raw result goes through syscall_ret(), which returns the count on success
* and -1 with errno set on error; errno is untouched on success.
*/
ssize_t
writev(int fd, const struct iovec *iov, int iovcnt)
{
return syscall_ret(__syscall3(SYS_writev, fd, (long)iov, (long)iovcnt));
}