[libglnx] missing-syscalls: Use different name for copy_file_range



commit 03e16afa7f2cf7ce517b604035683fa0409f730c
Author: Jonathan Lebon <jonathan jlebon com>
Date:   Fri May 4 13:35:34 2018 -0400

    missing-syscalls: Use different name for copy_file_range
    
    In glibc 2.27, a wrapper for `copy_file_range` was added[1]. The
    function is now always defined, either using a userspace fallback or
    just returning `ENOSYS` if the kernel doesn't support it. This throws
    off our preprocessor conditionals. Work around this by just renaming our
    implementation differently. This is similar to what systemd did[2].
    
    Hit this when trying to build on F28, which rebased to glibc 2.27.
    
    [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f
    [2] https://github.com/systemd/systemd/commit/5187dd2c403caf92d09f3491e41f1ceb3f10491f

 glnx-missing-syscall.h |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/glnx-missing-syscall.h b/glnx-missing-syscall.h
index ebfd7f4..4876ca3 100644
--- a/glnx-missing-syscall.h
+++ b/glnx-missing-syscall.h
@@ -140,10 +140,10 @@ static inline int memfd_create(const char *name, unsigned int flags) {
 #    endif
 #  endif
 
-static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
-                                      int fd_out, loff_t *off_out,
-                                      size_t len,
-                                      unsigned int flags) {
+static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in,
+                                              int fd_out, loff_t *off_out,
+                                              size_t len,
+                                              unsigned int flags) {
 #  ifdef __NR_copy_file_range
         return syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags);
 #  else
@@ -151,4 +151,6 @@ static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
         return -1;
 #  endif
 }
+
+#  define copy_file_range missing_copy_file_range
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]