Skip to main content

Errno

Struct Errno 

Source
pub struct Errno(/* private fields */);
Expand description

Code d’erreur kernel Linux.

#[repr(transparent)] sur NonZeroI32 : taille identique à un i32, et Option<Errno> occupe également cette taille (niche optimization).

Implementations§

Source§

impl Errno

Source

pub const EPERM: Self

Operation not permitted (1).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64.

Source

pub const ENOENT: Self

No such file or directory (2).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : openat/openat2 quand le chemin n’existe pas.

Source

pub const ESRCH: Self

No such process (3).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : pidfd_open quand le PID cible n’existe plus.

Source

pub const EINTR: Self

Interrupted system call (4).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : convention 2 d’ADR-021, remonté tel quel par waitid.

Source

pub const EBADF: Self

Bad file descriptor (9).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : test prouvant que Drop sur PidFd ferme bien le FD (waitid sur le RawFd post-drop retourne EBADF).

Source

pub const EAGAIN: Self

Try again / operation would block (11).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : lectures non bloquantes sur signalfd et timerfd sans événement disponible.

Source

pub const ECHILD: Self

No child processes (10).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : waitid quand la cible n’a pas d’enfant.

Source

pub const ENOMEM: Self

Out of memory (12).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : getrandom quand la mémoire kernel est insuffisante.

Source

pub const EFAULT: Self

Bad address / fault (14).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : syscalls qui accèdent à de la mémoire utilisateur (ne se produit pas via l’API safe).

Source

pub const EINVAL: Self

Invalid argument (22).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : clone3 rejet en amont (stack: Some(_) ou flags création de thread), waitid options vides.

Source

pub const ENFILE: Self

File table overflow / quota de FD système atteint (23).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : eventfd2, pipe2 quand la limite système de FD ouverts est atteinte.

Source

pub const EMFILE: Self

Too many open files / quota de FD du processus atteint (24).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : eventfd2, pipe2 quand le quota de FD du processus est épuisé.

Source

pub const EACCES: Self

Permission denied (13).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : mmap/mprotect quand les permissions sont refusées (ex. PROT_EXEC sur FS noexec).

Source

pub const ENODEV: Self

No such device (19).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : mmap quand le FD référence un type de fichier non mappable.

Source

pub const EEXIST: Self

File exists (17).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : mmap avec MAP_FIXED_NOREPLACE quand l’adresse cible est déjà occupée.

Source

pub const ENOSYS: Self

Function not implemented (38).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : memfd_secret sur kernel < 5.14 ou sans support compilé.

Source

pub const ESPIPE: Self

Illegal seek on pipe or FIFO (29).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : splice quand un offset non nul est passé pour un FD pipe (non seekable).

Source

pub const EBUSY: Self

Device or resource busy (16).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : back-pressure structurelle du slab io_uring (S1) — submit_* refuse poliment quand in_flight == capacity, avant tout syscall.

Source

pub const ETIME: Self

Timer expired (62).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : expiration d’attente io_uring (wait_completion_timeout, selon le mapping interne EXT_ARG).

Source

pub const EALREADY: Self

Operation already in progress (114).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : io_uring sync_cancel quand une annulation est déjà en cours pour la cible visée.

Source

pub const ECANCELED: Self

Operation canceled (125).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : res == -ECANCELED d’un CQE d’opération annulée pendant la quiescence io_uring (téardown S2) — déroulement nominal, pas un échec.

Source

pub const E2BIG: Self

Argument list too long (7).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : bpf_map_create quand la carte demandée est trop grande.

Source

pub const ENOTTY: Self

Inappropriate ioctl for device (25).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : un ioctl EVIOC* sur un FD qui n’est pas un périphérique d’entrée evdev.

Source

pub const ERANGE: Self

Numerical result out of range (34).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Extension additive du sceau pilotée par un contrat couche 1 : air_terminal::tty::ttyname la retourne quand le tampon fourni par l’appelant est trop petit pour le chemin du terminal (sémantique POSIX ttyname_r).

Source

pub const ENOSPC: Self

No space left on device (28).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : buffer de log du vérifieur eBPF trop court (bpf_program_load / bpf_btf_load).

Source

pub const EPROTO: Self

Protocol error (71).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : lecture evdev d’un nombre d’octets non multiple de size_of::<input_event>().

Source

pub const EBADMSG: Self

Bad message (74).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : décodage uevent — message vide, en-tête libudev tronqué / magic absent / offsets hors borne.

Source

pub const EMSGSIZE: Self

Message too long (90).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : message uevent tronqué (buffer de réception trop petit).

Source

pub const EOPNOTSUPP: Self

Operation not supported (95).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : opérations eBPF / perf_event_open non supportées par le kernel courant.

Source

pub const ENOBUFS: Self

No buffer space available (105).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : file de réception netlink uevent saturée.

Source

pub const EXDEV: Self

Cross-device link (18).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : contrat air-filesystem (# Errors — copie/renommage inter-FS, repli read/write sur EXDEV).

Source

pub const EPIPE: Self

Broken pipe (32).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Référencé : contrat air-base-lib §1 (From<Errno>AirErrorKind::BrokenResource).

Source

pub const ELOOP: Self

Too many symbolic links encountered (40).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : contrat air-filesystem (# Errors — boucle de symlink, tentative d’évasion de confinement).

Source

pub const ECONNRESET: Self

Connection reset by peer (104).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : contrat air-base-lib §1 (From<Errno>AirErrorKind::BrokenResource).

Source

pub const ETIMEDOUT: Self

Connection timed out (110).

Valeur extraite de asm-generic/errno.h ; identique sur x86_64 et aarch64. Référencé : contrat air-base-lib §1 (From<Errno>AirErrorKind::TimedOut). Distinct d’Errno::ETIME (62, « timer expired ») — ETIMEDOUT est 110, « connection timed out ».

Source

pub const ENOEXEC: Self

Exec format error (8).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Extension additive pilotée par le contrat couche 1 (air-process) : execve/execveat sur un fichier qui n’est pas dans un format exécutable reconnu (ni ELF, ni script avec #!).

Source

pub const ENOTDIR: Self

Not a directory (20).

Valeur extraite de asm-generic/errno-base.h ; identique sur x86_64 et aarch64. Extension additive pilotée par le contrat couche 1 (air-process) : fchdir sur un fd qui ne référence pas un répertoire, ou chdir/execveat dont un composant du chemin n’est pas un répertoire.

Source

pub const EWOULDBLOCK: Self = Self::EAGAIN

Operation would block — alias de Errno::EAGAIN (valeur 11).

Sur Linux EWOULDBLOCK == EAGAIN (même valeur). Exposé comme alias nommé pour que les contrats qui le citent (air-base-lib §1 : EAGAIN/EWOULDBLOCKWouldBlock) puissent mapper par nom ; EWOULDBLOCK == EAGAIN reste vrai (PartialEq sur la valeur brute).

Source

pub const fn from_nonzero(raw: NonZeroI32) -> Self

Construit un Errno à partir d’un brut non nul déjà validé.

Source

pub const fn try_from_raw(raw: i32) -> Option<Self>

Tente de construire un Errno à partir d’un entier brut.

Retourne None si raw est nul (erreur kernel impossible) ou négatif (les errno kernel sont des entiers positifs).

Source

pub const fn as_raw(self) -> i32

Retourne la représentation brute (positive) du code errno.

Trait Implementations§

Source§

impl Clone for Errno

Source§

fn clone(&self) -> Errno

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Errno

Source§

impl Debug for Errno

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Errno

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Errno

Source§

impl Error for Errno

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl Hash for Errno

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Errno

Source§

fn eq(&self, other: &Errno) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Errno

Auto Trait Implementations§

§

impl Freeze for Errno

§

impl RefUnwindSafe for Errno

§

impl Send for Errno

§

impl Sync for Errno

§

impl Unpin for Errno

§

impl UnsafeUnpin for Errno

§

impl UnwindSafe for Errno

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.