From c647fb885cb678471f6b6a66f394b4ca5515a016 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 3 Jul 2017 14:39:52 -0300 Subject: Consolidate non cancellable write call This patch consolidates all the non cancellable write calls to use the __write_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. * sysdeps/generic/not-cancel.h (write_not_cancel): Remove macro. (__write_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (__write_nocancel): Rewrite as a function prototype. (write_not_cancel): Remove macro. * sysdeps/unix/sysv/linux/write.c (__write_nocancel): New function. * gmon/gmon.c (ERR): Replace write_not_cancel with __write_nocancel. (write_gmon): Likewise. * libio/fileops.c (_IO_new_file_write): Likewise. * login/utmp_file.c (pututline_file): Likewise. (updwtmp_file): Likewise. * stdio-common/psiginfo.c (psiginfo): Likewise. * sysdeps/posix/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise. --- sysdeps/unix/sysv/linux/not-cancel.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sysdeps/unix/sysv/linux/not-cancel.h') diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h index 3d26075e11..84dc72a1f2 100644 --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -39,8 +39,8 @@ __typeof (__read) __read_nocancel; libc_hidden_proto (__read_nocancel) /* Uncancelable write. */ -#define __write_nocancel(fd, buf, len) \ - INLINE_SYSCALL (write, 3, fd, buf, len) +__typeof (__write) __write_nocancel; +libc_hidden_proto (__write_nocancel) /* Uncancelable openat. */ #define openat_not_cancel(fd, fname, oflag, mode) \ @@ -61,10 +61,6 @@ libc_hidden_proto (__read_nocancel) (void) ({ INTERNAL_SYSCALL_DECL (err); \ INTERNAL_SYSCALL (close, err, 1, (fd)); }) -/* Uncancelable write. */ -#define write_not_cancel(fd, buf, n) \ - __write_nocancel (fd, buf, n) - /* Uncancelable writev. */ #define writev_not_cancel_no_status(fd, iov, n) \ (void) ({ INTERNAL_SYSCALL_DECL (err); \ -- cgit v1.2.3