feat(uio): readv/writev
This commit is contained in:
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user