2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
12 #include <errno_private.h>
15 #define RETURN_AND_SET_ERRNO(err) \
24 readv(int fd
, const struct iovec
*vecs
, size_t count
)
26 ssize_t bytes
= _kern_readv(fd
, -1, vecs
, count
);
28 RETURN_AND_SET_ERRNO(bytes
);
33 readv_pos(int fd
, off_t pos
, const struct iovec
*vecs
, size_t count
)
37 __set_errno(B_BAD_VALUE
);
40 bytes
= _kern_readv(fd
, pos
, vecs
, count
);
42 RETURN_AND_SET_ERRNO(bytes
);
47 writev(int fd
, const struct iovec
*vecs
, size_t count
)
49 ssize_t bytes
= _kern_writev(fd
, -1, vecs
, count
);
51 RETURN_AND_SET_ERRNO(bytes
);
56 writev_pos(int fd
, off_t pos
, const struct iovec
*vecs
, size_t count
)
60 __set_errno(B_BAD_VALUE
);
63 bytes
= _kern_writev(fd
, pos
, vecs
, count
);
65 RETURN_AND_SET_ERRNO(bytes
);