Skip to content

Commit

Permalink
Enable O_DSYNC on FreeBSD with fcntl and aio_fsync (#2404)
Browse files Browse the repository at this point in the history
It first appeared in FreeBSD 13.0.
  • Loading branch information
asomers authored May 16, 2024
1 parent f577c20 commit e7acaff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/2404.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`O_DSYNC` may now be used with `aio_fsync` and `fcntl` on FreeBSD.
2 changes: 1 addition & 1 deletion src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ libc_bitflags!(
/// If the specified path isn't a directory, fail.
O_DIRECTORY;
/// Implicitly follow each `write()` with an `fdatasync()`.
#[cfg(any(linux_android, apple_targets, netbsdlike))]
#[cfg(any(linux_android, apple_targets, target_os = "freebsd", netbsdlike))]
O_DSYNC;
/// Error out if a file was not created.
O_EXCL;
Expand Down
1 change: 1 addition & 0 deletions src/sys/aio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ libc_enum! {
/// on supported operating systems only, do it like `fdatasync`
#[cfg(any(apple_targets,
target_os = "linux",
target_os = "freebsd",
netbsdlike))]
O_DSYNC
}
Expand Down

0 comments on commit e7acaff

Please sign in to comment.