From 82f070702c58ccbbf04f8330b24c1e7767072eb0 Mon Sep 17 00:00:00 2001
From: Sergio Lopez <slp@redhat.com>
Date: Wed, 25 Mar 2020 13:02:50 +0100
Subject: [PATCH] Add copy_file_range to linux_like/linux/gnu

This is a Linux-only feature that was already present as a
syscall. Add it just to linux/gnu for the moment, as the musl version
bundled in the Rust's x86_64-unknown-linux-musl toolchain doesn't
include it yet.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 src/unix/linux_like/linux/gnu/mod.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs
index 02645fdd..d0af5cb1 100644
--- a/src/unix/linux_like/linux/gnu/mod.rs
+++ b/src/unix/linux_like/linux/gnu/mod.rs
@@ -1198,6 +1198,14 @@ extern "C" {
     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
     #[link_name = "ntp_gettimex"]
     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
+    pub fn copy_file_range(
+        fd_in: ::c_int,
+        off_in: *mut ::off64_t,
+        fd_out: ::c_int,
+        off_out: *mut ::off64_t,
+        len: ::size_t,
+        flags: ::c_uint,
+    ) -> ::ssize_t;
 }
 
 #[link(name = "util")]
-- 
GitLab