diff options
author | Nicolas Thery <nthery@gmail.com> | 2021-04-17 09:29:33 +0200 |
---|---|---|
committer | Nicolas Thery <nthery@gmail.com> | 2021-04-17 12:58:32 +0200 |
commit | c8539f5bc6061c41a56d13451297fb9d5a258c59 (patch) | |
tree | 4f5cd41a72965a7ceedc83eaf80b633f81953963 /src | |
parent | 2c40088cced1fdbd3230d521ae5babb73fbe33a6 (diff) | |
download | rust-libc-c8539f5bc6061c41a56d13451297fb9d5a258c59.tar.gz |
Add macos clonefile functions
Diffstat (limited to 'src')
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 6d77692480..a5703ef5d6 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -3835,6 +3835,24 @@ extern "C" { outbytesleft: *mut ::size_t, ) -> ::size_t; pub fn iconv_close(cd: iconv_t) -> ::c_int; + + // Copy-on-write functions. + // According to the man page `flags` is an `int` but in the header + // this is a `uint32_t`. + pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int; + pub fn clonefileat( + src_dirfd: ::c_int, + src: *const ::c_char, + dst_dirfd: ::c_int, + dst: *const ::c_char, + flags: u32, + ) -> ::c_int; + pub fn fclonefileat( + srcfd: ::c_int, + dst_dirfd: ::c_int, + dst: *const ::c_char, + flags: u32, + ) -> ::c_int; } cfg_if! { |