about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-07-03 15:33:23 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-08-21 15:37:45 -0300
commit19926de954bf89feb443aadd4db47a4e912b97b1 (patch)
treea9112ddb6db33274f5b609458695c9ce2723e8c1 /sysdeps/unix/sysv/linux
parentdf1deda60050cc8a68156cf6c81ad42363647a29 (diff)
downloadglibc-19926de954bf89feb443aadd4db47a4e912b97b1.tar.gz
glibc-19926de954bf89feb443aadd4db47a4e912b97b1.tar.xz
glibc-19926de954bf89feb443aadd4db47a4e912b97b1.zip
Consolidate non cancellable writev call
This patch consolidates all the non cancellable writev calls to use
the __writev_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* gmon/gmon.c (write_hist): Replace writev_not_cancel_no_status with
	__writev_nocancel_nostatus.
	(write_call_graph): Likewise.
	(write_bb_counts): Likewise.
	* resolv/herror.c (herror): Likewise.
	* sysdeps/generic/not-cancel.h (writev_not_cancel_no_status): Remove
	macro.
	(__writev_nocancel_nostatus): New macro.
	* sysdeps/unix/sysv/linux/not-cancel.h (writev_not_cancel_no_status):
	Remove macro.
	(__writev_nocancel_nostatus): New function.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/not-cancel.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index 51824515da..29926d3494 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -62,10 +62,14 @@ __close_nocancel_nostatus (int fd)
   __close_nocancel (fd);
 }
 
-/* Uncancelable writev.  */
-#define writev_not_cancel_no_status(fd, iov, n) \
-  (void) ({ INTERNAL_SYSCALL_DECL (err);				      \
-	    INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
+/* Non cancellable writev syscall that does not also set errno in case of
+   failure.  */
+static inline void
+__writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt)
+{
+  INTERNAL_SYSCALL_DECL (err);
+  INTERNAL_SYSCALL_CALL (writev, err, fd, iov, iovcnt);
+}
 
 /* Uncancelable fcntl.  */
 #define fcntl_not_cancel(fd, cmd, val) \