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 9, 2022
1 parent 6eee580 commit bf24b46
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -717,6 +717,8 @@ FF1
FFDLY
FF_CNT
FF_MAX
FICLONE
FICLONERANGE
FILENAME_MAX
FIONCLEX
FIONREAD
Expand Down Expand Up @@ -2909,6 +2911,7 @@ ff_rumble_effect
ff_trigger
fgetpos64
fgetxattr
file_clone_range
flistxattr
fmemopen
fopen64
Expand Down
18 changes: 18 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 @@ -2380,6 +2387,17 @@ 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

#[cfg(not(target_arch = "mips"))]
pub const FICLONE: ::c_ulong = 0x40049409;
#[cfg(target_arch = "mips")]
pub const FICLONE: ::c_ulong = 0x80092812;
#[cfg(not(target_arch = "mips"))]
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
#[cfg(target_arch = "mips")]
pub const FICLONERANGE: ::c_ulong = 0x8041281A;

// linux/genetlink.h

pub const GENL_NAMSIZ: ::c_int = 16;
Expand Down

0 comments on commit bf24b46

Please sign in to comment.