Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: use linux_kernel cfg
  • Loading branch information
fsavy-tehtris committed Dec 19, 2023
commit c3e5ae90b1e2050300ef5a56041d3204a25f095f
6 changes: 3 additions & 3 deletions src/backend/libc/io/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::backend::c;
#[cfg(not(target_os = "wasi"))]
use crate::backend::conv::ret_discarded_fd;
use crate::backend::conv::{borrowed_fd, ret, ret_c_int, ret_owned_fd, ret_usize};
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
use crate::backend::io::types::IFlags;
use crate::fd::{AsFd, BorrowedFd, OwnedFd, RawFd};
#[cfg(not(any(
Expand Down Expand Up @@ -219,7 +219,7 @@ pub(crate) unsafe fn ioctl_readonly(
ioctl(fd, request, arg)
}

#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
#[inline]
pub(crate) fn ioctl_get_flags(fd: BorrowedFd<'_>) -> io::Result<IFlags> {
let mut result = core::mem::MaybeUninit::<IFlags>::uninit();
Expand All @@ -235,7 +235,7 @@ pub(crate) fn ioctl_get_flags(fd: BorrowedFd<'_>) -> io::Result<IFlags> {
}
}

#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
#[inline]
pub(crate) fn ioctl_set_flags(fd: BorrowedFd<'_>, flags: IFlags) -> io::Result<()> {
#[cfg(target_pointer_width = "32")]
Expand Down
2 changes: 1 addition & 1 deletion src/backend/linux_raw/io/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::backend::conv::{
};
#[cfg(target_pointer_width = "32")]
use crate::backend::conv::{hi, lo};
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
use crate::backend::io::types::IFlags;
use crate::backend::{c, MAX_IOV};
use crate::fd::{AsFd, BorrowedFd, OwnedFd, RawFd};
Expand Down
6 changes: 3 additions & 3 deletions src/io/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{backend, io, ioctl};
use backend::c;
use backend::fd::AsFd;

#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
pub use backend::io::types::IFlags;

/// `ioctl(fd, FIOCLEX, NULL)`—Set the close-on-exec flag.
Expand Down Expand Up @@ -82,7 +82,7 @@ pub fn ioctl_fionread<Fd: AsFd>(fd: Fd) -> io::Result<u64> {
/// `ioctl(fd, FS_IOC_GETFLAGS)`—Returns the [inode flags] attributes
///
/// [inode flags]: https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
#[inline]
#[doc(alias = "FS_IOC_GETFLAGS")]
pub fn ioctl_getflags<Fd: AsFd>(fd: Fd) -> io::Result<IFlags> {
Expand All @@ -92,7 +92,7 @@ pub fn ioctl_getflags<Fd: AsFd>(fd: Fd) -> io::Result<IFlags> {
/// `ioctl(fd, FS_IOC_SETFLAGS)`—Modify the [inode flags] attributes
///
/// [inode flags]: https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html
#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(linux_kernel)]
#[inline]
#[doc(alias = "FS_IOC_GETFLAGS")]
pub fn ioctl_setflags<Fd: AsFd>(fd: Fd, flags: IFlags) -> io::Result<()> {
Expand Down