Auto merge of #2147 - nthery:clonefile, r=JohnTitor
Add macos clonefile functions
This commit is contained in:
commit
6570c66a41
|
@ -217,6 +217,8 @@ fn test_apple(target: &str) {
|
||||||
"stdio.h",
|
"stdio.h",
|
||||||
"stdlib.h",
|
"stdlib.h",
|
||||||
"string.h",
|
"string.h",
|
||||||
|
"sys/attr.h",
|
||||||
|
"sys/clonefile.h",
|
||||||
"sys/event.h",
|
"sys/event.h",
|
||||||
"sys/file.h",
|
"sys/file.h",
|
||||||
"sys/ioctl.h",
|
"sys/ioctl.h",
|
||||||
|
|
|
@ -1514,6 +1514,8 @@ chflags
|
||||||
chroot
|
chroot
|
||||||
clearerr
|
clearerr
|
||||||
clock_getres
|
clock_getres
|
||||||
|
clonefile
|
||||||
|
clonefileat
|
||||||
cmsghdr
|
cmsghdr
|
||||||
connectx
|
connectx
|
||||||
cpu_subtype_t
|
cpu_subtype_t
|
||||||
|
@ -1531,6 +1533,7 @@ exchangedata
|
||||||
faccessat
|
faccessat
|
||||||
fchdir
|
fchdir
|
||||||
fchflags
|
fchflags
|
||||||
|
fclonefileat
|
||||||
fdopendir
|
fdopendir
|
||||||
fgetxattr
|
fgetxattr
|
||||||
flistxattr
|
flistxattr
|
||||||
|
|
|
@ -3835,6 +3835,24 @@ extern "C" {
|
||||||
outbytesleft: *mut ::size_t,
|
outbytesleft: *mut ::size_t,
|
||||||
) -> ::size_t;
|
) -> ::size_t;
|
||||||
pub fn iconv_close(cd: iconv_t) -> ::c_int;
|
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! {
|
cfg_if! {
|
||||||
|
|
Loading…
Reference in New Issue