diff options
author | Rich Felker <dalias@aerifal.cx> | 2024-01-25 12:02:34 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2024-01-25 12:02:34 -0500 |
commit | 81cced6ebeb4419a78a8892ec7d7e28f5582d24a (patch) | |
tree | 03afb3bafc8b7262e5e05dd71a6254b5ef27c5ca /src/linux/pwritev2.c | |
parent | f247462b0831cbf163e976ee9a909748c674b88b (diff) | |
download | musl-81cced6ebeb4419a78a8892ec7d7e28f5582d24a.tar.gz |
add preadv2 and pwritev2 syscall wrappers, flag value macros
Diffstat (limited to 'src/linux/pwritev2.c')
-rw-r--r-- | src/linux/pwritev2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/linux/pwritev2.c b/src/linux/pwritev2.c new file mode 100644 index 00000000..ece90d7c --- /dev/null +++ b/src/linux/pwritev2.c @@ -0,0 +1,17 @@ +#define _GNU_SOURCE +#include <sys/uio.h> +#include <unistd.h> +#include "syscall.h" + +ssize_t pwritev2(int fd, const struct iovec *iov, int count, off_t ofs, int flags) +{ +#ifdef SYS_pwritev + if (!flags) { + if (ofs==-1) return writev(fd, iov, count); + return syscall_cp(SYS_pwritev, fd, iov, count, + (long)(ofs), (long)(ofs>>32)); + } +#endif + return syscall_cp(SYS_pwritev2, fd, iov, count, + (long)(ofs), (long)(ofs>>32), flags); +} |