1 /*
2 * writev() for uClibc
3 *
4 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 *
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 */
8
9 #include <sys/syscall.h>
10 #include <sys/uio.h>
11 #include <cancel.h>
12
13 /* We should deal with kernel which have a smaller UIO_FASTIOV as well
14 as a very big count. */
__NC(writev)15 static ssize_t __NC(writev)(int fd, const struct iovec *vector, int count)
16 {
17 ssize_t bytes_written = INLINE_SYSCALL(writev, 3, fd, vector, count);
18
19 if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
20 return bytes_written;
21
22 /* glibc tries again, but we do not. */
23 /* return __atomic_writev_replacement (fd, vector, count); */
24
25 return -1;
26 }
27 CANCELLABLE_SYSCALL(ssize_t, writev, (int fd, const struct iovec *vector, int count), (fd, vector, count))
28