pwritev.c\unistd\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/unistd/pwritev.c
blob: 44a53d857627419707eac7d68a44f8519975333f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define _GNU_SOURCE
#include <sys/uio.h>
#include <unistd.h>
#include <fcntl.h>
#include "syscall.h"
ssize_t pwritev(int fd, const struct iovec *iov, int count, off_t ofs)
{
	if (ofs == -1) ofs--;
	int r = __syscall_cp(SYS_pwritev2, fd, iov, count,
		(long)(ofs), (long)(ofs>>32), RWF_NOAPPEND);
	if (r != -EOPNOTSUPP && r != -ENOSYS)
		return __syscall_ret(r);
	if (fcntl(fd, F_GETFL) & O_APPEND)
		return __syscall_ret(-EOPNOTSUPP);
	return syscall_cp(SYS_pwritev, fd, iov, count,
		(long)(ofs), (long)(ofs>>32));
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月06日 04:49:14 +0000

AltStyle によって変換されたページ (->オリジナル) /