diff --git a/changelog/2708.added.md b/changelog/2708.added.md new file mode 100644 index 0000000000..0f3ff1d1d0 --- /dev/null +++ b/changelog/2708.added.md @@ -0,0 +1 @@ +add sync() for cygwin diff --git a/src/unistd.rs b/src/unistd.rs index 8995fbe02e..7802fe7ff0 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -1667,7 +1667,15 @@ pub fn chroot(path: &P) -> Result<()> { /// Commit filesystem caches to disk /// /// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html) -#[cfg(any(bsd, linux_android, solarish, target_os = "haiku", target_os = "aix", target_os = "hurd"))] +#[cfg(any( + bsd, + linux_android, + solarish, + target_os = "haiku", + target_os = "aix", + target_os = "hurd", + target_os = "cygwin" +))] pub fn sync() { unsafe { libc::sync() }; }