Skip to content

Commit

Permalink
Add O_ASYNC/FASYNC to OFlags (#1312)
Browse files Browse the repository at this point in the history
Closes #1243
  • Loading branch information
yuki0iq authored Feb 6, 2025
1 parent b710cf2 commit 3ae4069
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/backend/libc/fs/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,20 @@ bitflags! {
#[cfg(any(linux_kernel, solarish))]
const LARGEFILE = bitcast!(c::O_LARGEFILE);

/// `O_ASYNC`, `FASYNC`
///
/// Note that this flag can't be used with [`rustix::fs::open`] family of functions, use
/// [`rustix::fs::fcntl_setfl`] instead
#[cfg(not(any(
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "wasi",
target_os = "vita",
solarish
)))]
const ASYNC = bitcast!(c::O_ASYNC);

/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
Expand Down
6 changes: 6 additions & 0 deletions src/backend/linux_raw/fs/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ bitflags! {
/// It will may be reported in return of `fcntl_getfl`, though.
const LARGEFILE = linux_raw_sys::general::O_LARGEFILE;

/// `O_ASYNC`, `FASYNC`
///
/// Note that this flag can't be used with [`rustix::fs::open`] family of functions, use
/// [`rustix::fs::fcntl_setfl`] instead
const ASYNC = linux_raw_sys::general::FASYNC;

/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
Expand Down

0 comments on commit 3ae4069

Please sign in to comment.