|
@@ -9,42 +9,20 @@
|
|
|
|
|
|
#include <sys/syscall.h>
|
|
|
#include <sys/uio.h>
|
|
|
-
|
|
|
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
|
|
|
-#include <errno.h>
|
|
|
-#include <sysdep-cancel.h>
|
|
|
+#include <cancel.h>
|
|
|
|
|
|
|
|
|
as a very big count. */
|
|
|
-static ssize_t __writev (int fd, const struct iovec *vector, int count)
|
|
|
+static ssize_t __NC(writev)(int fd, const struct iovec *vector, int count)
|
|
|
{
|
|
|
- ssize_t bytes_written;
|
|
|
-
|
|
|
- bytes_written = INLINE_SYSCALL (writev, 3, fd, vector, count);
|
|
|
-
|
|
|
- if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
|
|
|
- return bytes_written;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return -1;
|
|
|
-}
|
|
|
-
|
|
|
-ssize_t writev (int fd, const struct iovec *vector, int count)
|
|
|
-{
|
|
|
- if (SINGLE_THREAD_P)
|
|
|
- return __writev (fd, vector, count);
|
|
|
-
|
|
|
- int oldtype = LIBC_CANCEL_ASYNC ();
|
|
|
+ ssize_t bytes_written = INLINE_SYSCALL(writev, 3, fd, vector, count);
|
|
|
|
|
|
- ssize_t result = __writev (fd, vector, count);
|
|
|
+ if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV)
|
|
|
+ return bytes_written;
|
|
|
|
|
|
- LIBC_CANCEL_RESET (oldtype);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- return result;
|
|
|
+ return -1;
|
|
|
}
|
|
|
-#else
|
|
|
-_syscall3(ssize_t, writev, int, filedes, const struct iovec *, vector,
|
|
|
- int, count)
|
|
|
-#endif
|
|
|
+CANCELLABLE_SYSCALL(ssize_t, writev, (int fd, const struct iovec *vector, int count), (fd, vector, count))
|