Skip to content

Commit

Permalink
Add fdatasync for missing platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
rtzoeller committed Dec 21, 2021
1 parent 4f7119c commit ac62901
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Added fine-grained features flags. Most Nix functionality can now be
conditionally enabled. By default, all features are enabled.
(#[1611](https://github.com/nix-rust/nix/pull/1611))
- Added `fdatasync` for FreeBSD, Fuchsia, NetBSD, and OpenBSD.
(#[1581](https://github.com/nix-rust/nix/pull/1581))

### Changed
### Fixed
Expand Down
6 changes: 4 additions & 2 deletions src/unistd.rs
Expand Up @@ -1325,11 +1325,13 @@ pub fn fsync(fd: RawFd) -> Result<()> {
///
/// See also
/// [fdatasync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html)
// `fdatasync(2) is in POSIX, but in libc it is only defined in `libc::notbsd`.
// TODO: exclude only Apple systems after https://github.com/rust-lang/libc/pull/211
#[cfg(any(target_os = "linux",
target_os = "android",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "netbsd",
target_os = "openbsd",
target_os = "illumos",
target_os = "solaris"))]
#[inline]
Expand Down

0 comments on commit ac62901

Please sign in to comment.