Skip to content

Commit e7acaff

Browse files
authored
Enable O_DSYNC on FreeBSD with fcntl and aio_fsync (#2404)
It first appeared in FreeBSD 13.0.
1 parent f577c20 commit e7acaff

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

changelog/2404.added.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`O_DSYNC` may now be used with `aio_fsync` and `fcntl` on FreeBSD.

src/fcntl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ libc_bitflags!(
114114
/// If the specified path isn't a directory, fail.
115115
O_DIRECTORY;
116116
/// Implicitly follow each `write()` with an `fdatasync()`.
117-
#[cfg(any(linux_android, apple_targets, netbsdlike))]
117+
#[cfg(any(linux_android, apple_targets, target_os = "freebsd", netbsdlike))]
118118
O_DSYNC;
119119
/// Error out if a file was not created.
120120
O_EXCL;

src/sys/aio.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ libc_enum! {
5555
/// on supported operating systems only, do it like `fdatasync`
5656
#[cfg(any(apple_targets,
5757
target_os = "linux",
58+
target_os = "freebsd",
5859
netbsdlike))]
5960
O_DSYNC
6061
}

0 commit comments

Comments
 (0)