]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Clean up preadv, pwritev system call names
authorFlorian Weimer <fweimer@redhat.com>
Tue, 3 Mar 2020 11:15:06 +0000 (12:15 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 3 Mar 2020 11:15:06 +0000 (12:15 +0100)
The names __NR_preadv64, __NR_pwritev64 appear to be a glibc invention.
With the built-in tables, __NR_preadv and __NR_pwritev are always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/preadv.c
sysdeps/unix/sysv/linux/preadv64.c
sysdeps/unix/sysv/linux/pwritev.c
sysdeps/unix/sysv/linux/pwritev64.c

index 2a55d8c142ff6e61af9929c0440437ab8fb50f9e..9fccb917a1116c2e75ba734d62b69421a2d7a458 100644 (file)
 
 # ifdef __ASSUME_PREADV
 
-#  ifndef __NR_preadv
-#   define __NR_preadv __NR_preadv64
-#  endif
-
 ssize_t
 preadv (int fd, const struct iovec *vector, int count, off_t offset)
 {
@@ -37,12 +33,10 @@ static ssize_t __atomic_preadv_replacement (int, const struct iovec *,
 ssize_t
 preadv (int fd, const struct iovec *vector, int count, off_t offset)
 {
-#  ifdef __NR_preadv
   ssize_t result = SYSCALL_CANCEL (preadv, fd, vector, count,
                                   LO_HI_LONG (offset));
   if (result >= 0 || errno != ENOSYS)
     return result;
-#  endif
   return __atomic_preadv_replacement (fd, vector, count, offset);
 }
 #  define PREADV static __atomic_preadv_replacement
index fb471f0d9d1712daf3e0ac02d08fe00872a27548..9fe43522a5833faad7e48727a0c358b659b74c59 100644 (file)
 
 #ifdef __ASSUME_PREADV
 
-# ifndef __NR_preadv64
-#  define __NR_preadv64 __NR_preadv
-# endif
-
 ssize_t
 preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
 {
-  return SYSCALL_CANCEL (preadv64, fd, vector, count, LO_HI_LONG (offset));
+  return SYSCALL_CANCEL (preadv, fd, vector, count, LO_HI_LONG (offset));
 }
 #else
 static ssize_t __atomic_preadv64_replacement (int, const struct iovec *,
@@ -35,12 +31,10 @@ static ssize_t __atomic_preadv64_replacement (int, const struct iovec *,
 ssize_t
 preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
 {
-#ifdef __NR_preadv64
-  ssize_t result = SYSCALL_CANCEL (preadv64, fd, vector, count,
+  ssize_t result = SYSCALL_CANCEL (preadv, fd, vector, count,
                                   LO_HI_LONG (offset));
   if (result >= 0 || errno != ENOSYS)
     return result;
-#endif
   return __atomic_preadv64_replacement (fd, vector, count, offset);
 }
 # define PREADV static __atomic_preadv64_replacement
index 7abe47be064ffda33d805bacf9a04d93bf15e51b..d6cb3c8d5cfb664a3c3bedd0c892ff11d0203a2b 100644 (file)
 
 # ifdef __ASSUME_PREADV
 
-#  ifndef __NR_pwritev
-#   define __NR_pwritev __NR_pwritev64
-#  endif
-
 ssize_t
 pwritev (int fd, const struct iovec *vector, int count, off_t offset)
 {
@@ -37,12 +33,10 @@ static ssize_t __atomic_pwritev_replacement (int, const struct iovec *,
 ssize_t
 pwritev (int fd, const struct iovec *vector, int count, off_t offset)
 {
-#  ifdef __NR_pwritev
   ssize_t result = SYSCALL_CANCEL (pwritev, fd, vector, count,
                                   LO_HI_LONG (offset));
   if (result >= 0 || errno != ENOSYS)
     return result;
-#  endif
   return __atomic_pwritev_replacement (fd, vector, count, offset);
 }
 #  define PWRITEV static __atomic_pwritev_replacement
index 9bb0399c449e77f88bf0e03c177f45e26c90bd39..08bda27d4f3684f42500a530c5bb0196f73c7ca4 100644 (file)
 
 #ifdef __ASSUME_PWRITEV
 
-# ifndef __NR_pwritev64
-#  define __NR_pwritev64 __NR_pwritev
-# endif
-
 ssize_t
 pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset)
 {
-  return SYSCALL_CANCEL (pwritev64, fd, vector, count, LO_HI_LONG (offset));
+  return SYSCALL_CANCEL (pwritev, fd, vector, count, LO_HI_LONG (offset));
 }
 #else
 static ssize_t __atomic_pwritev64_replacement (int, const struct iovec *,
@@ -35,12 +31,10 @@ static ssize_t __atomic_pwritev64_replacement (int, const struct iovec *,
 ssize_t
 pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset)
 {
-#ifdef __NR_pwritev64
-  ssize_t result = SYSCALL_CANCEL (pwritev64, fd, vector, count,
+  ssize_t result = SYSCALL_CANCEL (pwritev, fd, vector, count,
                                   LO_HI_LONG (offset));
   if (result >= 0 || errno != ENOSYS)
     return result;
-#endif
   return __atomic_pwritev64_replacement (fd, vector, count, offset);
 }
 # define PWRITEV static __atomic_pwritev64_replacement