Skip to content

Commit 11494ec

Browse files
committed
Add fdatasync for missing platforms
1 parent 78f2301 commit 11494ec

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1313
(#[1611](https://github.com/nix-rust/nix/pull/1611))
1414
- Added `EPOLLEXCLUSIVE` on Android.
1515
(#[1567](https://github.com/nix-rust/nix/pull/1567))
16+
- Added `fdatasync` for FreeBSD, Fuchsia, NetBSD, and OpenBSD.
17+
(#[1581](https://github.com/nix-rust/nix/pull/1581))
1618

1719
### Changed
1820
### Fixed

src/unistd.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,11 +1323,13 @@ pub fn fsync(fd: RawFd) -> Result<()> {
13231323
///
13241324
/// See also
13251325
/// [fdatasync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html)
1326-
// `fdatasync(2) is in POSIX, but in libc it is only defined in `libc::notbsd`.
1327-
// TODO: exclude only Apple systems after https://github.com/rust-lang/libc/pull/211
13281326
#[cfg(any(target_os = "linux",
13291327
target_os = "android",
13301328
target_os = "emscripten",
1329+
target_os = "freebsd",
1330+
target_os = "fuchsia",
1331+
target_os = "netbsd",
1332+
target_os = "openbsd",
13311333
target_os = "illumos",
13321334
target_os = "solaris"))]
13331335
#[inline]

0 commit comments

Comments
 (0)