diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
commit | d1b2d29528b7794b41e66fc2136e395a02f8529b (patch) | |
tree | a4a17504b260206dec3cf55b2dca82929a348ac2 /vendor/rustix/src/backend/libc/pipe | |
parent | Releasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/backend/libc/pipe')
-rw-r--r-- | vendor/rustix/src/backend/libc/pipe/syscalls.rs | 24 | ||||
-rw-r--r-- | vendor/rustix/src/backend/libc/pipe/types.rs | 7 |
2 files changed, 23 insertions, 8 deletions
diff --git a/vendor/rustix/src/backend/libc/pipe/syscalls.rs b/vendor/rustix/src/backend/libc/pipe/syscalls.rs index c5ded9174..24262cc9a 100644 --- a/vendor/rustix/src/backend/libc/pipe/syscalls.rs +++ b/vendor/rustix/src/backend/libc/pipe/syscalls.rs @@ -2,7 +2,14 @@ use crate::backend::c; use crate::backend::conv::ret; use crate::fd::OwnedFd; use crate::io; -#[cfg(not(any(apple, target_os = "aix", target_os = "haiku", target_os = "wasi")))] +#[cfg(not(any( + apple, + target_os = "aix", + target_os = "espidf", + target_os = "haiku", + target_os = "nto", + target_os = "wasi" +)))] use crate::pipe::PipeFlags; use core::mem::MaybeUninit; #[cfg(linux_kernel)] @@ -11,7 +18,7 @@ use { crate::backend::MAX_IOV, crate::fd::BorrowedFd, crate::pipe::{IoSliceRaw, SpliceFlags}, - crate::utils::optional_as_mut_ptr, + crate::utils::option_as_mut_ptr, core::cmp::min, }; @@ -25,7 +32,14 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> { } } -#[cfg(not(any(apple, target_os = "aix", target_os = "haiku", target_os = "wasi")))] +#[cfg(not(any( + apple, + target_os = "aix", + target_os = "espidf", + target_os = "haiku", + target_os = "nto", + target_os = "wasi" +)))] pub(crate) fn pipe_with(flags: PipeFlags) -> io::Result<(OwnedFd, OwnedFd)> { unsafe { let mut result = MaybeUninit::<[OwnedFd; 2]>::uninit(); @@ -48,8 +62,8 @@ pub fn splice( len: usize, flags: SpliceFlags, ) -> io::Result<usize> { - let off_in = optional_as_mut_ptr(off_in).cast(); - let off_out = optional_as_mut_ptr(off_out).cast(); + let off_in = option_as_mut_ptr(off_in).cast(); + let off_out = option_as_mut_ptr(off_out).cast(); unsafe { ret_usize(c::splice( diff --git a/vendor/rustix/src/backend/libc/pipe/types.rs b/vendor/rustix/src/backend/libc/pipe/types.rs index f48d8041b..3fa0464e0 100644 --- a/vendor/rustix/src/backend/libc/pipe/types.rs +++ b/vendor/rustix/src/backend/libc/pipe/types.rs @@ -16,7 +16,9 @@ bitflags! { /// `O_DIRECT` #[cfg(not(any( solarish, + target_os = "espidf", target_os = "haiku", + target_os = "nto", target_os = "openbsd", target_os = "redox", )))] @@ -85,9 +87,8 @@ impl<'a> IoSliceRaw<'a> { #[cfg(not(any(apple, target_os = "wasi")))] #[test] fn test_types() { - use core::mem::size_of; - assert_eq!(size_of::<PipeFlags>(), size_of::<c::c_int>()); + assert_eq_size!(PipeFlags, c::c_int); #[cfg(linux_kernel)] - assert_eq!(size_of::<SpliceFlags>(), size_of::<c::c_int>()); + assert_eq_size!(SpliceFlags, c::c_int); } |