all(target_os = "linux", target_env = "gnu"),
target_os = "macos",
target_os = "ios",
+ target_os = "watchos",
))]
use crate::sys::weak::syscall;
#[cfg(target_os = "macos")]
#[cfg(any(
target_os = "macos",
target_os = "ios",
+ target_os = "watchos",
all(target_os = "linux", target_env = "gnu")
))]
use libc::c_char;
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
- target_os = "ios"
+ target_os = "ios",
+ target_os = "watchos",
))]
pub fn created(&self) -> io::Result<SystemTime> {
Ok(SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtime_nsec as i64))
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
- target_os = "ios"
+ target_os = "ios",
+ target_os = "watchos",
)))]
pub fn created(&self) -> io::Result<SystemTime> {
cfg_has_statx! {
#[cfg(any(
target_os = "macos",
target_os = "ios",
+ target_os = "watchos",
target_os = "linux",
target_os = "emscripten",
target_os = "android",
#[cfg(any(
target_os = "macos",
target_os = "ios",
+ target_os = "watchos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "freebsd",
#[cfg(not(any(
target_os = "macos",
target_os = "ios",
+ target_os = "watchos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "freebsd",
cvt_r(|| unsafe { os_fsync(self.as_raw_fd()) })?;
return Ok(());
- #[cfg(any(target_os = "macos", target_os = "ios"))]
+ #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))]
unsafe fn os_fsync(fd: c_int) -> c_int {
libc::fcntl(fd, libc::F_FULLFSYNC)
}
- #[cfg(not(any(target_os = "macos", target_os = "ios")))]
+ #[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "watchos")))]
unsafe fn os_fsync(fd: c_int) -> c_int {
libc::fsync(fd)
}
cvt_r(|| unsafe { os_datasync(self.as_raw_fd()) })?;
return Ok(());
- #[cfg(any(target_os = "macos", target_os = "ios"))]
+ #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))]
unsafe fn os_datasync(fd: c_int) -> c_int {
libc::fcntl(fd, libc::F_FULLFSYNC)
}
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
- target_os = "openbsd"
+ target_os = "openbsd",
+ target_os = "watchos",
)))]
unsafe fn os_datasync(fd: c_int) -> c_int {
libc::fsync(fd)
target_os = "linux",
target_os = "android",
target_os = "macos",
- target_os = "ios"
+ target_os = "ios",
+ target_os = "watchos",
)))]
pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
let (mut reader, reader_metadata) = open_from(from)?;
}
}
-#[cfg(any(target_os = "macos", target_os = "ios"))]
+#[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))]
pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
use crate::sync::atomic::{AtomicBool, Ordering};