Skip to content

Commit 3ae4069

Browse files
authored
Add O_ASYNC/FASYNC to OFlags (#1312)
Closes #1243
1 parent b710cf2 commit 3ae4069

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/backend/libc/fs/types.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,20 @@ bitflags! {
338338
#[cfg(any(linux_kernel, solarish))]
339339
const LARGEFILE = bitcast!(c::O_LARGEFILE);
340340

341+
/// `O_ASYNC`, `FASYNC`
342+
///
343+
/// Note that this flag can't be used with [`rustix::fs::open`] family of functions, use
344+
/// [`rustix::fs::fcntl_setfl`] instead
345+
#[cfg(not(any(
346+
target_os = "aix",
347+
target_os = "espidf",
348+
target_os = "haiku",
349+
target_os = "wasi",
350+
target_os = "vita",
351+
solarish
352+
)))]
353+
const ASYNC = bitcast!(c::O_ASYNC);
354+
341355
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
342356
const _ = !0;
343357
}

src/backend/linux_raw/fs/types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ bitflags! {
257257
/// It will may be reported in return of `fcntl_getfl`, though.
258258
const LARGEFILE = linux_raw_sys::general::O_LARGEFILE;
259259

260+
/// `O_ASYNC`, `FASYNC`
261+
///
262+
/// Note that this flag can't be used with [`rustix::fs::open`] family of functions, use
263+
/// [`rustix::fs::fcntl_setfl`] instead
264+
const ASYNC = linux_raw_sys::general::FASYNC;
265+
260266
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
261267
const _ = !0;
262268
}

0 commit comments

Comments
 (0)