Skip to content

Commit b4e4fea

Browse files
committed
Auto merge of #2899 - devnexen:linux_fileclone, r=JohnTitor
linux add FICLONE* ioctl.
2 parents 6eee580 + 9ebc2c1 commit b4e4fea

File tree

9 files changed

+22
-0
lines changed

9 files changed

+22
-0
lines changed

libc-test/semver/linux.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ FF1
717717
FFDLY
718718
FF_CNT
719719
FF_MAX
720+
FICLONE
721+
FICLONERANGE
720722
FILENAME_MAX
721723
FIONCLEX
722724
FIONREAD
@@ -2909,6 +2911,7 @@ ff_rumble_effect
29092911
ff_trigger
29102912
fgetpos64
29112913
fgetxattr
2914+
file_clone_range
29122915
flistxattr
29132916
fmemopen
29142917
fopen64

src/unix/linux_like/linux/mod.rs

Lines changed: 12 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! {
@@ -2380,6 +2387,11 @@ pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001;
23802387
pub const NFQA_SKB_GSO: ::c_int = 0x0002;
23812388
pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004;
23822389

2390+
// linux/fs.h
2391+
2392+
pub const FICLONE: ::c_ulong = 0x40049409;
2393+
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
2394+
23832395
// linux/genetlink.h
23842396

23852397
pub const GENL_NAMSIZ: ::c_int = 16;

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_ulonglong;
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_ulonglong;
67
pub type greg_t = i64;
78

89
s! {

0 commit comments

Comments
 (0)