Skip to content

Commit

Permalink
linux add FICLONE* ioctl.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Sep 5, 2022
1 parent b6e4704 commit 9ebc2c1
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -588,6 +588,8 @@ FF1
FFDLY
FF_CNT
FF_MAX
FICLONE
FICLONERANGE
FILENAME_MAX
FIONCLEX
FIONREAD
Expand Down Expand Up @@ -2770,6 +2772,7 @@ ff_rumble_effect
ff_trigger
fgetpos64
fgetxattr
file_clone_range
flistxattr
fmemopen
fopen64
Expand Down
12 changes: 12 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -596,6 +596,13 @@ s! {
pub nla_len: u16,
pub nla_type: u16,
}

pub struct file_clone_range {
pub src_fd: ::__s64,
pub src_offset: ::__u64,
pub src_length: ::__u64,
pub dest_offset: ::__u64,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -2225,6 +2232,11 @@ pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001;
pub const NFQA_SKB_GSO: ::c_int = 0x0002;
pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004;

// linux/fs.h

pub const FICLONE: ::c_ulong = 0x40049409;
pub const FICLONERANGE: ::c_ulong = 0x4020940D;

// linux/genetlink.h

pub const GENL_NAMSIZ: ::c_int = 16;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/mod.rs
Expand Up @@ -3,6 +3,7 @@ pub type c_ulong = u32;
pub type nlink_t = u32;
pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
pub type __s64 = ::c_longlong;
pub type regoff_t = ::c_int;

s! {
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
@@ -1,5 +1,6 @@
pub type c_char = u8;
pub type __u64 = ::c_ulonglong;
pub type __s64 = ::c_ulonglong;
pub type wchar_t = u32;
pub type nlink_t = u32;
pub type blksize_t = ::c_int;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/mips64.rs
@@ -1,6 +1,7 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
pub type __s64 = ::c_long;
pub type nlink_t = u64;
pub type blksize_t = i64;

Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/powerpc64.rs
@@ -1,6 +1,7 @@
pub type c_char = u8;
pub type wchar_t = i32;
pub type __u64 = ::c_ulong;
pub type __s64 = ::c_long;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;

Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
Expand Up @@ -8,6 +8,7 @@ pub type blksize_t = ::c_int;
pub type fsblkcnt64_t = ::c_ulong;
pub type fsfilcnt64_t = ::c_ulong;
pub type __u64 = ::c_ulonglong;
pub type __s64 = ::c_longlong;

s! {
pub struct pthread_attr_t {
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/s390x.rs
Expand Up @@ -4,6 +4,7 @@ pub type nlink_t = u64;
pub type wchar_t = i32;
pub type greg_t = u64;
pub type __u64 = u64;
pub type __s64 = i64;

s! {
pub struct ipc_perm {
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
Expand Up @@ -3,6 +3,7 @@ pub type wchar_t = i32;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
pub type __s64 = ::c_ulonglong;
pub type greg_t = i64;

s! {
Expand Down

0 comments on commit 9ebc2c1

Please sign in to comment.