Skip to content

Commit a88aec3

Browse files
committed
Auto merge of #2899 - devnexen:linux_fileclone, r=JohnTitor
linux add FICLONE* ioctl.
2 parents 8531d01 + 152bb49 commit a88aec3

File tree

13 files changed

+26
-0
lines changed

13 files changed

+26
-0
lines changed

libc-test/semver/linux-gnu-x86_64.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
FICLONE
2+
FICLONERANGE
13
KEYCTL_CAPABILITIES
24
KEYCTL_CAPS0_BIG_KEY
35
KEYCTL_CAPS0_CAPABILITIES

libc-test/semver/linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,7 @@ ff_rumble_effect
29092909
ff_trigger
29102910
fgetpos64
29112911
fgetxattr
2912+
file_clone_range
29122913
flistxattr
29132914
fmemopen
29142915
fopen64

src/unix/linux_like/linux/arch/generic/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ cfg_if! {
104104
pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
105105
}
106106
}
107+
108+
cfg_if! {
109+
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
110+
pub const FICLONE: ::c_ulong = 0x40049409;
111+
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
112+
}
113+
}
107114
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
108115
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
109116

src/unix/linux_like/linux/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,13 @@ s! {
596596
pub nla_len: u16,
597597
pub nla_type: u16,
598598
}
599+
600+
pub struct file_clone_range {
601+
pub src_fd: ::__s64,
602+
pub src_offset: ::__u64,
603+
pub src_length: ::__u64,
604+
pub dest_offset: ::__u64,
605+
}
599606
}
600607

601608
s_no_extra_traits! {

src/unix/linux_like/linux/musl/b32/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub type c_ulong = u32;
33
pub type nlink_t = u32;
44
pub type blksize_t = ::c_long;
55
pub type __u64 = ::c_ulonglong;
6+
pub type __s64 = ::c_longlong;
67
pub type regoff_t = ::c_int;
78

89
s! {

src/unix/linux_like/linux/musl/b64/aarch64/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub type c_char = u8;
22
pub type __u64 = ::c_ulonglong;
3+
pub type __s64 = ::c_longlong;
34
pub type wchar_t = u32;
45
pub type nlink_t = u32;
56
pub type blksize_t = ::c_int;

src/unix/linux_like/linux/musl/b64/mips64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = i8;
22
pub type wchar_t = i32;
33
pub type __u64 = ::c_ulong;
4+
pub type __s64 = ::c_long;
45
pub type nlink_t = u64;
56
pub type blksize_t = i64;
67

src/unix/linux_like/linux/musl/b64/powerpc64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = u8;
22
pub type wchar_t = i32;
33
pub type __u64 = ::c_ulong;
4+
pub type __s64 = ::c_long;
45
pub type nlink_t = u64;
56
pub type blksize_t = ::c_long;
67

src/unix/linux_like/linux/musl/b64/riscv64/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub type blksize_t = ::c_int;
88
pub type fsblkcnt64_t = ::c_ulong;
99
pub type fsfilcnt64_t = ::c_ulong;
1010
pub type __u64 = ::c_ulonglong;
11+
pub type __s64 = ::c_longlong;
1112

1213
s! {
1314
pub struct pthread_attr_t {

src/unix/linux_like/linux/musl/b64/s390x.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pub type nlink_t = u64;
44
pub type wchar_t = i32;
55
pub type greg_t = u64;
66
pub type __u64 = u64;
7+
pub type __s64 = i64;
78

89
s! {
910
pub struct ipc_perm {

src/unix/linux_like/linux/musl/b64/x86_64/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub type wchar_t = i32;
33
pub type nlink_t = u64;
44
pub type blksize_t = ::c_long;
55
pub type __u64 = ::c_ulonglong;
6+
pub type __s64 = ::c_longlong;
67
pub type greg_t = i64;
78

89
s! {

src/unix/linux_like/linux/uclibc/arm/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub type blkcnt_t = ::c_long;
1919
pub type fsblkcnt64_t = u64;
2020
pub type fsfilcnt64_t = u64;
2121
pub type __u64 = ::c_ulonglong;
22+
pub type __s64 = ::c_longlong;
2223

2324
s! {
2425
pub struct cmsghdr {

src/unix/linux_like/linux/uclibc/x86_64/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub type wchar_t = ::c_int;
2020
pub type fsblkcnt64_t = u64;
2121
pub type fsfilcnt64_t = u64;
2222
pub type __u64 = ::c_ulong;
23+
pub type __s64 = ::c_long;
2324

2425
s! {
2526
pub struct ipc_perm {

0 commit comments

Comments
 (0)