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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy