summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/libc/io
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/backend/libc/io')
-rw-r--r--vendor/rustix/src/backend/libc/io/errno.rs107
-rw-r--r--vendor/rustix/src/backend/libc/io/syscalls.rs16
-rw-r--r--vendor/rustix/src/backend/libc/io/types.rs6
3 files changed, 118 insertions, 11 deletions
diff --git a/vendor/rustix/src/backend/libc/io/errno.rs b/vendor/rustix/src/backend/libc/io/errno.rs
index 1448fe7bd..731086b4f 100644
--- a/vendor/rustix/src/backend/libc/io/errno.rs
+++ b/vendor/rustix/src/backend/libc/io/errno.rs
@@ -52,7 +52,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const ADV: Self = Self(c::EADV);
@@ -74,7 +76,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const BADE: Self = Self(c::EBADE);
@@ -87,7 +91,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const BADFD: Self = Self(c::EBADFD);
@@ -101,7 +107,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const BADR: Self = Self(c::EBADR);
@@ -115,7 +123,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const BADRQC: Self = Self(c::EBADRQC);
@@ -126,7 +136,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const BADSLT: Self = Self(c::EBADSLT);
@@ -137,7 +149,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const BFONT: Self = Self(c::EBFONT);
@@ -159,7 +173,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const CHRNG: Self = Self(c::ECHRNG);
@@ -170,7 +186,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const COMM: Self = Self(c::ECOMM);
@@ -191,6 +209,8 @@ impl Errno {
target_os = "android",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const DEADLOCK: Self = Self(c::EDEADLOCK);
@@ -214,8 +234,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const DOTDOT: Self = Self(c::EDOTDOT);
@@ -246,9 +268,11 @@ impl Errno {
target_os = "android",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "redox",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const HWPOISON: Self = Self(c::EHWPOISON);
@@ -293,8 +317,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const ISNAM: Self = Self(c::EISNAM);
@@ -306,8 +332,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const KEYEXPIRED: Self = Self(c::EKEYEXPIRED);
@@ -319,8 +347,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const KEYREJECTED: Self = Self(c::EKEYREJECTED);
@@ -332,8 +362,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const KEYREVOKED: Self = Self(c::EKEYREVOKED);
@@ -343,7 +375,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const L2HLT: Self = Self(c::EL2HLT);
@@ -353,7 +387,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const L2NSYNC: Self = Self(c::EL2NSYNC);
@@ -363,7 +399,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const L3HLT: Self = Self(c::EL3HLT);
@@ -373,7 +411,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const L3RST: Self = Self(c::EL3RST);
@@ -384,7 +424,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const LIBACC: Self = Self(c::ELIBACC);
@@ -395,7 +437,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const LIBBAD: Self = Self(c::ELIBBAD);
@@ -407,6 +451,7 @@ impl Errno {
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const LIBEXEC: Self = Self(c::ELIBEXEC);
@@ -417,7 +462,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const LIBMAX: Self = Self(c::ELIBMAX);
@@ -428,7 +475,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const LIBSCN: Self = Self(c::ELIBSCN);
@@ -438,7 +487,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const LNRNG: Self = Self(c::ELNRNG);
@@ -452,8 +503,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const MEDIUMTYPE: Self = Self(c::EMEDIUMTYPE);
@@ -478,8 +531,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NAVAIL: Self = Self(c::ENAVAIL);
@@ -503,7 +558,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NOANO: Self = Self(c::ENOANO);
@@ -519,7 +576,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const NOCSI: Self = Self(c::ENOCSI);
@@ -549,8 +608,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NOKEY: Self = Self(c::ENOKEY);
@@ -568,8 +629,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NOMEDIUM: Self = Self(c::ENOMEDIUM);
@@ -589,7 +652,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NONET: Self = Self(c::ENONET);
@@ -600,7 +665,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NOPKG: Self = Self(c::ENOPKG);
@@ -634,7 +701,13 @@ impl Errno {
#[cfg(not(windows))]
pub const NOSYS: Self = Self(c::ENOSYS);
/// `ENOTBLK`
- #[cfg(not(any(windows, target_os = "espidf", target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "vita",
+ target_os = "wasi"
+ )))]
pub const NOTBLK: Self = Self(c::ENOTBLK);
/// `ENOTCAPABLE`
#[cfg(any(target_os = "freebsd", target_os = "wasi"))]
@@ -654,8 +727,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NOTNAM: Self = Self(c::ENOTNAM);
@@ -684,7 +759,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const NOTUNIQ: Self = Self(c::ENOTUNIQ);
@@ -751,7 +828,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const REMCHG: Self = Self(c::EREMCHG);
@@ -760,6 +839,7 @@ impl Errno {
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const REMOTE: Self = Self(c::EREMOTE);
@@ -771,8 +851,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const REMOTEIO: Self = Self(c::EREMOTEIO);
@@ -782,7 +864,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const RESTART: Self = Self(c::ERESTART);
@@ -795,9 +879,11 @@ impl Errno {
target_os = "android",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
target_os = "redox",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const RFKILL: Self = Self(c::ERFKILL);
@@ -808,13 +894,19 @@ impl Errno {
#[cfg(bsd)]
pub const RPCMISMATCH: Self = Self(c::ERPCMISMATCH);
/// `ESHUTDOWN`
- #[cfg(not(any(target_os = "espidf", target_os = "l4re", target_os = "wasi")))]
+ #[cfg(not(any(
+ target_os = "espidf",
+ target_os = "l4re",
+ target_os = "vita",
+ target_os = "wasi"
+ )))]
pub const SHUTDOWN: Self = Self(c::ESHUTDOWN);
/// `ESOCKTNOSUPPORT`
#[cfg(not(any(
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const SOCKTNOSUPPORT: Self = Self(c::ESOCKTNOSUPPORT);
@@ -831,7 +923,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const SRMNT: Self = Self(c::ESRMNT);
@@ -844,7 +938,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const STRPIPE: Self = Self(c::ESTRPIPE);
@@ -877,8 +973,10 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const UCLEAN: Self = Self(c::EUCLEAN);
@@ -888,7 +986,9 @@ impl Errno {
windows,
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const UNATCH: Self = Self(c::EUNATCH);
@@ -897,6 +997,7 @@ impl Errno {
target_os = "espidf",
target_os = "haiku",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi"
)))]
pub const USERS: Self = Self(c::EUSERS);
@@ -912,7 +1013,9 @@ impl Errno {
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
+ target_os = "hurd",
target_os = "l4re",
+ target_os = "vita",
target_os = "wasi",
)))]
pub const XFULL: Self = Self(c::EXFULL);
diff --git a/vendor/rustix/src/backend/libc/io/syscalls.rs b/vendor/rustix/src/backend/libc/io/syscalls.rs
index 19ecfa9b6..8d5aefadc 100644
--- a/vendor/rustix/src/backend/libc/io/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/io/syscalls.rs
@@ -9,6 +9,7 @@ use crate::fd::{AsFd, BorrowedFd, OwnedFd, RawFd};
target_os = "aix",
target_os = "espidf",
target_os = "nto",
+ target_os = "vita",
target_os = "wasi"
)))]
use crate::io::DupFlags;
@@ -51,8 +52,8 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], offset: u64) -> io::Resu
// Silently cast; we'll get `EINVAL` if the value is negative.
let offset = offset as i64;
- // ESP-IDF doesn't support 64-bit offsets.
- #[cfg(target_os = "espidf")]
+ // ESP-IDF and Vita don't support 64-bit offsets.
+ #[cfg(any(target_os = "espidf", target_os = "vita"))]
let offset: i32 = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?;
unsafe {
@@ -71,8 +72,8 @@ pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], offset: u64) -> io::Result<
// Silently cast; we'll get `EINVAL` if the value is negative.
let offset = offset as i64;
- // ESP-IDF doesn't support 64-bit offsets.
- #[cfg(target_os = "espidf")]
+ // ESP-IDF and Vita don't support 64-bit offsets.
+ #[cfg(any(target_os = "espidf", target_os = "vita"))]
let offset: i32 = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?;
unsafe { ret_usize(c::pwrite(borrowed_fd(fd), buf.as_ptr().cast(), len, offset)) }
@@ -105,7 +106,8 @@ pub(crate) fn writev(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>]) -> io::Result<usi
target_os = "haiku",
target_os = "nto",
target_os = "redox",
- target_os = "solaris"
+ target_os = "solaris",
+ target_os = "vita"
)))]
pub(crate) fn preadv(
fd: BorrowedFd<'_>,
@@ -129,7 +131,8 @@ pub(crate) fn preadv(
target_os = "haiku",
target_os = "nto",
target_os = "redox",
- target_os = "solaris"
+ target_os = "solaris",
+ target_os = "vita"
)))]
pub(crate) fn pwritev(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize> {
// Silently cast; we'll get `EINVAL` if the value is negative.
@@ -316,6 +319,7 @@ pub(crate) fn dup2(fd: BorrowedFd<'_>, new: &mut OwnedFd) -> io::Result<()> {
target_os = "haiku",
target_os = "nto",
target_os = "redox",
+ target_os = "vita",
target_os = "wasi",
)))]
pub(crate) fn dup3(fd: BorrowedFd<'_>, new: &mut OwnedFd, flags: DupFlags) -> io::Result<()> {
diff --git a/vendor/rustix/src/backend/libc/io/types.rs b/vendor/rustix/src/backend/libc/io/types.rs
index eaf3eae71..510206f98 100644
--- a/vendor/rustix/src/backend/libc/io/types.rs
+++ b/vendor/rustix/src/backend/libc/io/types.rs
@@ -12,7 +12,7 @@ bitflags! {
/// `FD_CLOEXEC`
const CLOEXEC = bitcast!(c::FD_CLOEXEC);
- /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
}
@@ -37,7 +37,7 @@ bitflags! {
/// `RWF_APPEND` (since Linux 4.16)
const APPEND = linux_raw_sys::general::RWF_APPEND;
- /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
}
@@ -59,7 +59,7 @@ bitflags! {
)))] // Android 5.0 has dup3, but libc doesn't have bindings
const CLOEXEC = bitcast!(c::O_CLOEXEC);
- /// <https://docs.rs/bitflags/latest/bitflags/#externally-defined-flags>
+ /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
}