From cf6113d1aa733ad473de8909cabbd797aebe738c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=B6rwald?= Date: Tue, 11 Mar 2025 21:53:14 +0100 Subject: [PATCH] linux: Added _IO, _IOW, _IOR, _IOWR to the exported API --- libc-test/semver/linux.txt | 4 ++++ src/unix/linux_like/linux/mod.rs | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index ff391a928a8d8..bb0daf93b096e 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -3548,9 +3548,13 @@ _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS +_IO _IOFBF _IOLBF _IONBF +_IOR +_IOW +_IOWR _PC_2_SYMLINKS _PC_ALLOC_SIZE_MIN _PC_ASYNC_IO diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 86edcd3eabbdc..d09e75d1c7515 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -5893,22 +5893,22 @@ const fn _IOC(dir: u32, ty: u32, nr: u32, size: usize) -> u32 { } /// Build an ioctl number for an argumentless ioctl. -pub(crate) const fn _IO(ty: u32, nr: u32) -> u32 { +pub const fn _IO(ty: u32, nr: u32) -> u32 { _IOC(_IOC_NONE, ty, nr, 0) } /// Build an ioctl number for an read-only ioctl. -pub(crate) const fn _IOR(ty: u32, nr: u32) -> u32 { +pub const fn _IOR(ty: u32, nr: u32) -> u32 { _IOC(_IOC_READ, ty, nr, size_of::()) } /// Build an ioctl number for an write-only ioctl. -pub(crate) const fn _IOW(ty: u32, nr: u32) -> u32 { +pub const fn _IOW(ty: u32, nr: u32) -> u32 { _IOC(_IOC_WRITE, ty, nr, size_of::()) } /// Build an ioctl number for a read-write ioctl. -pub(crate) const fn _IOWR(ty: u32, nr: u32) -> u32 { +pub const fn _IOWR(ty: u32, nr: u32) -> u32 { _IOC(_IOC_READ | _IOC_WRITE, ty, nr, size_of::()) }