]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Clean up pread64/pwrite64 system call names
authorFlorian Weimer <fweimer@redhat.com>
Sun, 9 Feb 2020 15:07:00 +0000 (16:07 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 3 Mar 2020 11:14:40 +0000 (12:14 +0100)
Linux removed the last definitions of __NR_pread and __NR_pwrite
in commit 4ba66a9760722ccbb691b8f7116cad2f791cca7b, the removal
of the blackfin port.  All architectures now define __NR_pread64 and
__NR_pwrite64 only.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/generic/sysdep.h
sysdeps/unix/sysv/linux/pread.c
sysdeps/unix/sysv/linux/pread64.c
sysdeps/unix/sysv/linux/pread64_nocancel.c
sysdeps/unix/sysv/linux/pwrite.c
sysdeps/unix/sysv/linux/pwrite64.c
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h

index 23defce7c3e1be9ff5a91790124c6f30e648daed..40b4b955ca1b9df2b80f22633d3495736b88518c 100644 (file)
 #ifdef __NR_llseek
 # define __NR__llseek __NR_llseek
 #endif
-
-#if __WORDSIZE == 64
-/* By defining the older names, glibc will build syscall wrappers for
-   both pread and pread64; sysdeps/unix/sysv/linux/wordsize-64/pread64.c
-   will suppress generating any separate code for pread64.c.  */
-#define __NR_pread __NR_pread64
-#define __NR_pwrite __NR_pwrite64
-#endif
index 7a09affd348fcd689df509055de2c3e358da9ce5..8dd87b39765ed2d01ec670ab7a09cf5d26e56231 100644 (file)
 
 #ifndef __OFF_T_MATCHES_OFF64_T
 
-# ifndef __NR_pread
-#  define __NR_pread __NR_pread64
-# endif
-
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  return SYSCALL_CANCEL (pread, fd, buf, count, SYSCALL_LL_PRW (offset));
+  return SYSCALL_CANCEL (pread64, fd, buf, count, SYSCALL_LL_PRW (offset));
 }
 
 strong_alias (__libc_pread, __pread)
index a7f907186bdf72e736476452368951573204b33f..3d4ffbafc177e5420f06c1e00e6a3ffd90f1565c 100644 (file)
 #include <unistd.h>
 #include <sysdep-cancel.h>
 
-#ifndef __NR_pread64
-# define __NR_pread64 __NR_pread
-#endif
-
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
index 2eb6873e66a571c43f3039d0ce9ab413b1f50585..af339859594e544e360260e9bc81af08b29a13ae 100644 (file)
 #include <sysdep-cancel.h>
 #include <not-cancel.h>
 
-#ifndef __NR_pread64
-# define __NR_pread64 __NR_pread
-#endif
-
 ssize_t
 __pread64_nocancel (int fd, void *buf, size_t count, off64_t offset)
 {
index 5ef208e88506438b2da7e5bdf9eda3df38bbaa55..17964686e574ac07c8b1bff9115146b8d51f261e 100644 (file)
 
 #ifndef __OFF_T_MATCHES_OFF64_T
 
-# ifndef __NR_pwrite
-#  define __NR_pwrite __NR_pwrite64
-# endif
-
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, SYSCALL_LL_PRW (offset));
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count, SYSCALL_LL_PRW (offset));
 }
 
 strong_alias (__libc_pwrite, __pwrite)
index 632f001f5b304722dd262cc6a7f3628ad504745a..709775c2078e49459c5a730fddeed0fe30a0688c 100644 (file)
 #include <unistd.h>
 #include <sysdep-cancel.h>
 
-#ifndef __NR_pwrite64
-# define __NR_pwrite64 __NR_pwrite
-#endif
-
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
index c761a6303046bc4cdd25f37ae9c6610dc6cc3af6..39831a2ec2018e92f9d0145e98d22653065b7261 100644 (file)
 /* In newer 2.1 kernels __NR_syscall is missing so we define it here.  */
 #define __NR_syscall 0
 
-/*
- * Newer kernel versions redefined __NR_pread and __NR_pwrite to
- * __NR_pread64 and __NR_pwrite64.
- */
-#ifndef __NR_pread
-# define __NR_pread __NR_pread64
-#endif
-#ifndef __NR_pwrite
-# define __NR_pwrite __NR_pwrite64
-#endif
+#undef SYS_ify
+#define SYS_ify(syscall_name)  __NR_##syscall_name
 
 #ifdef __ASSEMBLER__