Errno#

📦 min

Symbolic names for the errno(3) values your system uses - EINTR, EAGAIN, ENOENT, EACCES, EEXIST, EIO, ENOTDIR, EISDIR, EBUSY, EPIPE, ECONNRESET, ECONNREFUSED, ETIMEDOUT, and every other errno name the host libc defines.

Most scripts reach for Errno to compare $! against a specific error after a failed system call, or to probe %! for the same purpose without touching $! by name.

Synopsis#

use Errno qw(EINTR EAGAIN);

if ($! == EINTR) { retry() }     # function form
if ($!{EAGAIN})  { backoff() }   # hash form via %!

The names and their numbers come from the errno.h of the host pperl was built on, and from the headers it includes, so scripts see exactly the errnos the kernel will actually raise. The :POSIX tag groups the POSIX-standard names for bulk import; nothing is exported by default.

Upstream’s Errno.pm is generated when perl is built, from those headers (ext/Errno/Errno_pm.PL); pperl’s build reads them the same way (src/build_errno.rs), so this native implementation of Errno 1.39 has the same names with the same values, the ones the libc crate lacks included.

Differences from upstream#

None.