#
# This file is auto-generated. ***ANY*** changes here will be lost
#
package Errno;
our (@EXPORT_OK,%EXPORT_TAGS,@ISA,$VERSION,%errno,$AUTOLOAD);
use Exporter ();
use Config;
use strict;
"$Config{'archname'}-$Config{'osvers'}" eq
"386-1" or
die "Errno architecture (386-1) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";
$VERSION = "1.09_00";
$VERSION = eval $VERSION;
@ISA = qw(Exporter);
@EXPORT_OK = qw(ENOSYS EAFNOSUPPORT EADDRNOTAVAIL EISCON EINTR
EHOSTDOWN EROFS ENOMEM ESHUTDOWN EPROTONOSUPPORT EPIPE ENETUNREACH
ENOTCONN ENFILE ENOLCK EADDRINUSE EOPNOTSUPP ECONNABORTED EBADF
ECANCELED EDEADLK ESPIPE ENOTDIR EMFILE ENAMETOOLONG EINVAL EACCES
ENOTTY ENOEXEC EXDEV EISDIR EBUSY E2BIG EPERM EEXIST ECONNREFUSED
ETOOMANYREFS EFBIG ENOENT EPFNOSUPPORT ESOCKTNOSUPPORT EGREG ETIMEDOUT
ENXIO ESRCH ENODEV EDOM EFAULT EMLINK EAGAIN EMSGSIZE ENOPROTOOPT
ECHILD ENETDOWN EHOSTUNREACH EPROTOTYPE ENOSPC EIO ENOTSOCK
EDESTADDRREQ ENETRESET ENOTEMPTY ERANGE ENOBUFS EINPROGRESS);
%EXPORT_TAGS = (
POSIX => [qw(
E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EBADF EBUSY
ECHILD ECONNABORTED ECONNREFUSED EDEADLK EDESTADDRREQ EDOM EEXIST
EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR EINVAL EIO
EISDIR EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET
ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM
ENOPROTOOPT ENOSPC ENOSYS ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY
ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROTONOSUPPORT EPROTOTYPE
ERANGE EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ETIMEDOUT
ETOOMANYREFS EXDEV
)]
);
sub E2BIG () { 1 }
sub EACCES () { 2 }
sub EAGAIN () { 3 }
sub EBADF () { 4 }
sub EBUSY () { 5 }
sub ECHILD () { 6 }
sub EDEADLK () { 7 }
sub EEXIST () { 8 }
sub EFAULT () { 9 }
sub EFBIG () { 10 }
sub EINTR () { 11 }
sub EINVAL () { 12 }
sub EIO () { 13 }
sub EISDIR () { 14 }
sub EMFILE () { 15 }
sub EMLINK () { 16 }
sub ENAMETOOLONG () { 17 }
sub ENFILE () { 18 }
sub ENODEV () { 19 }
sub ENOENT () { 20 }
sub ENOEXEC () { 21 }
sub ENOLCK () { 22 }
sub ENOMEM () { 23 }
sub ENOSPC () { 24 }
sub ENOSYS () { 25 }
sub ENOTDIR () { 26 }
sub ENOTEMPTY () { 27 }
sub ENOTTY () { 28 }
sub ENXIO () { 29 }
sub EPERM () { 30 }
sub EPIPE () { 31 }
sub EROFS () { 32 }
sub ESPIPE () { 33 }
sub ESRCH () { 34 }
sub EXDEV () { 35 }
sub ENOTSOCK () { 36 }
sub EPROTONOSUPPORT () { 37 }
sub EPROTOTYPE () { 37 }
sub ECONNREFUSED () { 38 }
sub EAFNOSUPPORT () { 39 }
sub ENOBUFS () { 40 }
sub EOPNOTSUPP () { 41 }
sub EADDRINUSE () { 42 }
sub EDESTADDRREQ () { 43 }
sub EMSGSIZE () { 44 }
sub ENOPROTOOPT () { 45 }
sub ESOCKTNOSUPPORT () { 46 }
sub EPFNOSUPPORT () { 47 }
sub EADDRNOTAVAIL () { 48 }
sub ENETDOWN () { 49 }
sub ENETUNREACH () { 50 }
sub ENETRESET () { 51 }
sub ECONNABORTED () { 52 }
sub EISCON () { 53 }
sub ENOTCONN () { 54 }
sub ESHUTDOWN () { 55 }
sub ETOOMANYREFS () { 56 }
sub ETIMEDOUT () { 57 }
sub EHOSTDOWN () { 58 }
sub EHOSTUNREACH () { 59 }
sub EGREG () { 60 }
sub ECANCELED () { 61 }
sub EINPROGRESS () { 62 }
sub EDOM () { 1000 }
sub ERANGE () { 1001 }
sub TIEHASH { bless [] }
sub FETCH {
my ($self, $errname) = @_;
my $proto = prototype("Errno::$errname");
my $errno = "";
if (defined($proto) && $proto eq "") {
no strict 'refs';
$errno = &$errname;
$errno = 0 unless $! == $errno;
}
return $errno;
}
sub STORE {
require Carp;
Carp::confess("ERRNO hash is read only!");
}
*CLEAR = \&STORE;
*DELETE = \&STORE;
sub NEXTKEY {
my($k,$v);
while(($k,$v) = each %Errno::) {
my $proto = prototype("Errno::$k");
last if (defined($proto) && $proto eq "");
}
$k
}
sub FIRSTKEY {
my $s = scalar keys %Errno::; # initialize iterator
goto &NEXTKEY;
}
sub EXISTS {
my ($self, $errname) = @_;
my $proto = prototype($errname);
defined($proto) && $proto eq "";
}
tie %!, __PACKAGE__;
1;
__END__
=head1 NAME
Errno - System errno constants
=head1 SYNOPSIS
use Errno qw(EINTR EIO :POSIX);
=head1 DESCRIPTION
C<Errno> defines and conditionally exports all the error constants
defined in your system C<errno.h> include file. It has a single export
tag, C<:POSIX>, which will export all POSIX defined error numbers.
C<Errno> also makes C<%!> magic such that each element of C<%!> has a
non-zero value only if C<$!> is set to that value. For example:
use Errno;
unless (open(FH, "/fangorn/spouse")) {
if ($!{ENOENT}) {
warn "Get a wife!\n";
} else {
warn "This path is barred: $!";
}
}
If a specified constant C<EFOO> does not exist on the system, C<$!{EFOO}>
returns C<"">. You may use C<exists $!{EFOO}> to check whether the
constant is available on the system.
=head1 CAVEATS
Importing a particular constant may not be very portable, because the
import will fail on platforms that do not have that constant. A more
portable way to set C<$!> to a valid value is to use:
if (exists &Errno::EFOO) {
$! = &Errno::EFOO;
}
=head1 AUTHOR
Graham Barr <[email protected]>
=head1 COPYRIGHT
Copyright (c) 1997-8 Graham Barr. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
|