diff --git a/changelog/2404.added.md b/changelog/2404.added.md new file mode 100644 index 0000000000..7f50f5bb01 --- /dev/null +++ b/changelog/2404.added.md @@ -0,0 +1 @@ +`O_DSYNC` may now be used with `aio_fsync` and `fcntl` on FreeBSD. diff --git a/src/fcntl.rs b/src/fcntl.rs index 043cdde473..fd8d4b847c 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -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; diff --git a/src/sys/aio.rs b/src/sys/aio.rs index 8d9e6c8061..c7ba40534c 100644 --- a/src/sys/aio.rs +++ b/src/sys/aio.rs @@ -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 }