Skip to content

Commit 1716fed

Browse files
authored
Add io_uring setup flags NO_MMAP and REGISTERED_FD_ONLY (#1056)
Adds the following setup flags: * `IORING_SETUP_NO_MMAP` - liburing 2.5, kernel 6.5 * `IORING_SETUP_REGISTERED_FD_ONLY` - liburing 2.5, kernel 6.5 Upgrades linux-raw-sys to 0.4.14 to provide the constants with the linux-raw backend. https://github.com/axboe/liburing/blob/master/src/include/liburing/io_uring.h#L188
1 parent f8f432d commit 1716fed

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ once_cell = { version = "1.5.2", optional = true }
3636
# libc backend can be selected via adding `--cfg=rustix_use_libc` to
3737
# `RUSTFLAGS` or enabling the `use-libc` cargo feature.
3838
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
39-
linux-raw-sys = { version = "0.4.12", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
39+
linux-raw-sys = { version = "0.4.14", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
4040
libc_errno = { package = "errno", version = "0.3.8", default-features = false, optional = true }
4141
libc = { version = "0.2.153", default-features = false, optional = true }
4242

@@ -53,7 +53,7 @@ libc = { version = "0.2.153", default-features = false }
5353
# Some syscalls do not have libc wrappers, such as in `io_uring`. For these,
5454
# the libc backend uses the linux-raw-sys ABI and `libc::syscall`.
5555
[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
56-
linux-raw-sys = { version = "0.4.12", default-features = false, features = ["general", "ioctl", "no_std"] }
56+
linux-raw-sys = { version = "0.4.14", default-features = false, features = ["general", "ioctl", "no_std"] }
5757

5858
# For the libc backend on Windows, use the Winsock API in windows-sys.
5959
[target.'cfg(windows)'.dependencies.windows-sys]

src/io_uring.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,12 @@ bitflags::bitflags! {
505505
/// `IORING_SETUP_DEFER_TASKRUN`
506506
const DEFER_TASKRUN = sys::IORING_SETUP_DEFER_TASKRUN;
507507

508+
/// `IORING_SETUP_NO_MMAP`
509+
const NO_MMAP = sys::IORING_SETUP_NO_MMAP;
510+
511+
/// `IORING_SETUP_REGISTERED_FD_ONLY`
512+
const REGISTERED_FD_ONLY = sys::IORING_SETUP_REGISTERED_FD_ONLY;
513+
508514
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
509515
const _ = !0;
510516
}

0 commit comments

Comments
 (0)