1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
13 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
15 #include <sysdep-cancel.h>
17 /* We should deal with kernel which have a smaller UIO_FASTIOV as well
18 as a very big count. */
19 static ssize_t __writev (int fd, const struct iovec *vector, int count)
21 ssize_t bytes_written;
23 bytes_written = INLINE_SYSCALL (writev, 3, fd, vector, count);
25 if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
28 /* glibc tries again, but we do not. */
29 /* return __atomic_writev_replacement (fd, vector, count); */
34 ssize_t writev (int fd, const struct iovec *vector, int count)
37 return __writev (fd, vector, count);
39 int oldtype = LIBC_CANCEL_ASYNC ();
41 ssize_t result = __writev (fd, vector, count);
43 LIBC_CANCEL_RESET (oldtype);
48 _syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector,