# Errno Native implementation of Errno Provides system errno constants for Linux. In real Perl, `Errno.pm` is auto-generated from system headers. We provide the same constants via native Rust implementation using the `libc` crate. The module exports constant subs like `ENOENT()`, `EACCES()`, etc. that return the errno integer value. It also provides `TIEHASH`, `FETCH`, `STORE`, `EXISTS`, `FIRSTKEY`, `NEXTKEY` methods for the `%!` tied hash. Perl equivalent: Errno # Functions ## EPERM, ENOENT, ESRCH, … (errno constants) Each errno name is a constant sub returning its integer value. Over 100 Linux errno constants are provided (see `ERRNO_CONSTANTS`). ```none use Errno qw(ENOENT EACCES); if ($! == ENOENT) { ... } ``` ## TIEHASH Ties the `%!` hash to the Errno module. Called implicitly by the runtime. ```none tie %!, 'Errno'; ``` ## FETCH Looks up an errno constant by name through the tied `%!` hash. ```none my $val = $!{ENOENT}; # returns 2 ``` ## EXISTS Checks whether a given name is a known errno constant. ```none if (exists $!{ENOENT}) { ... } ``` ## FIRSTKEY Returns the first errno constant name. Used by `each %!` and `keys %!`. ```none my $first = (keys %!)[0]; # "EPERM" ``` ## NEXTKEY Returns the next errno constant name after a given key. Drives hash iteration over `%!`. ```none while (my ($k, $v) = each %!) { ... } ```