Add a README.md file (so that our GitHub repository has something to show)
[msysgit.git] / lib / perl5 / 5.8.8 / msys / Errno.pm
blob8bfb25a903af03ea04315067b762709f6d4ae3af
2 # This file is auto-generated. ***ANY*** changes here will be lost
5 package Errno;
6 our (@EXPORT_OK,%EXPORT_TAGS,@ISA,$VERSION,%errno,$AUTOLOAD);
7 use Exporter ();
8 use Config;
9 use strict;
11 "$Config{'archname'}-$Config{'osvers'}" eq
12 "msys-1.0.11(0.4632)" or
13 die "Errno architecture (msys-1.0.11(0.4632)) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";
15 $VERSION = "1.09_01";
16 $VERSION = eval $VERSION;
17 @ISA = qw(Exporter);
19 @EXPORT_OK = qw(EADV ENOMSG EBADR EROFS ENOTSUP ESHUTDOWN EMULTIHOP
20 EPROTONOSUPPORT ENOLCK ENFILE EADDRINUSE EL3HLT ECONNABORTED EBADF
21 ECHRNG ENOTBLK EDEADLK ENOLINK ESRMNT ELNRNG ETIME ENOTDIR ENOTTY
22 EINVAL ENOANO EXDEV EBADE ELOOP EBADSLT ECONNREFUSED ENOSTR EISCONN
23 ENONET EFBIG ENOENT ECONNRESET EPFNOSUPPORT ELIBMAX EWOULDBLOCK
24 EBADMSG ENOMEDIUM EL2HLT ECASECLASH ENOPKG EDOM EBFONT ELIBSCN
25 EMSGSIZE ENOCSI EL3RST EDESTADDRREQ EIO ENOTSOCK ENOSPC EIDRM ENOBUFS
26 ERANGE EINPROGRESS ENOSYS EAFNOSUPPORT EADDRNOTAVAIL EINTR EHOSTDOWN
27 EREMOTE EBADFD ENOSR ENOMEM ENETUNREACH EPIPE ENOTCONN ESTALE ENODATA
28 EDQUOT EUSERS EOPNOTSUPP EPROTO ESPIPE EALREADY ENAMETOOLONG EMFILE
29 EACCES ENOEXEC EISDIR EPROCLIM ELBIN EBUSY EBADRQC EPERM E2BIG
30 ELIBEXEC EEXIST EDOTDOT ETOOMANYREFS ELIBACC ENOTUNIQ ELIBBAD ECOMM
31 ENOSHARE ESOCKTNOSUPPORT EUNATCH ETIMEDOUT ENXIO ESRCH EFAULT ENODEV
32 ETXTBSY EAGAIN EDEADLOCK ENMFILE EXFULL EMLINK ENOPROTOOPT ECHILD
33 ENETDOWN EHOSTUNREACH EPROTOTYPE EL2NSYNC EREMCHG ENETRESET
34 ENOTEMPTY);
36 %EXPORT_TAGS = (
37 POSIX => [qw(
38 E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY
39 EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
40 EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH
41 EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
42 EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS
43 ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK
44 ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
45 EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE
46 EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT
47 ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV
51 sub EPERM () { 1 }
52 sub ENOENT () { 2 }
53 sub ESRCH () { 3 }
54 sub EINTR () { 4 }
55 sub EIO () { 5 }
56 sub ENXIO () { 6 }
57 sub E2BIG () { 7 }
58 sub ENOEXEC () { 8 }
59 sub EBADF () { 9 }
60 sub ECHILD () { 10 }
61 sub EWOULDBLOCK () { 11 }
62 sub EAGAIN () { 11 }
63 sub ENOMEM () { 12 }
64 sub EACCES () { 13 }
65 sub EFAULT () { 14 }
66 sub ENOTBLK () { 15 }
67 sub EBUSY () { 16 }
68 sub EEXIST () { 17 }
69 sub EXDEV () { 18 }
70 sub ENODEV () { 19 }
71 sub ENOTDIR () { 20 }
72 sub EISDIR () { 21 }
73 sub EINVAL () { 22 }
74 sub ENFILE () { 23 }
75 sub EMFILE () { 24 }
76 sub ENOTTY () { 25 }
77 sub ETXTBSY () { 26 }
78 sub EFBIG () { 27 }
79 sub ENOSPC () { 28 }
80 sub ESPIPE () { 29 }
81 sub EROFS () { 30 }
82 sub EMLINK () { 31 }
83 sub EPIPE () { 32 }
84 sub EDOM () { 33 }
85 sub ERANGE () { 34 }
86 sub ENOMSG () { 35 }
87 sub EIDRM () { 36 }
88 sub ECHRNG () { 37 }
89 sub EL2NSYNC () { 38 }
90 sub EL3HLT () { 39 }
91 sub EL3RST () { 40 }
92 sub ELNRNG () { 41 }
93 sub EUNATCH () { 42 }
94 sub ENOCSI () { 43 }
95 sub EL2HLT () { 44 }
96 sub EDEADLK () { 45 }
97 sub ENOLCK () { 46 }
98 sub EBADE () { 50 }
99 sub EBADR () { 51 }
100 sub EXFULL () { 52 }
101 sub ENOANO () { 53 }
102 sub EBADRQC () { 54 }
103 sub EBADSLT () { 55 }
104 sub EDEADLOCK () { 56 }
105 sub EBFONT () { 57 }
106 sub ENOSTR () { 60 }
107 sub ENODATA () { 61 }
108 sub ETIME () { 62 }
109 sub ENOSR () { 63 }
110 sub ENONET () { 64 }
111 sub ENOPKG () { 65 }
112 sub EREMOTE () { 66 }
113 sub ENOLINK () { 67 }
114 sub EADV () { 68 }
115 sub ESRMNT () { 69 }
116 sub ECOMM () { 70 }
117 sub EPROTO () { 71 }
118 sub EMULTIHOP () { 74 }
119 sub ELBIN () { 75 }
120 sub EDOTDOT () { 76 }
121 sub EBADMSG () { 77 }
122 sub ENOTUNIQ () { 80 }
123 sub EBADFD () { 81 }
124 sub EREMCHG () { 82 }
125 sub ELIBACC () { 83 }
126 sub ELIBBAD () { 84 }
127 sub ELIBSCN () { 85 }
128 sub ELIBMAX () { 86 }
129 sub ELIBEXEC () { 87 }
130 sub ENOSYS () { 88 }
131 sub ENMFILE () { 89 }
132 sub ENOTEMPTY () { 90 }
133 sub ENAMETOOLONG () { 91 }
134 sub ELOOP () { 92 }
135 sub EOPNOTSUPP () { 95 }
136 sub EPFNOSUPPORT () { 96 }
137 sub ECONNRESET () { 104 }
138 sub ENOBUFS () { 105 }
139 sub EAFNOSUPPORT () { 106 }
140 sub EPROTOTYPE () { 107 }
141 sub ENOTSOCK () { 108 }
142 sub ENOPROTOOPT () { 109 }
143 sub ESHUTDOWN () { 110 }
144 sub ECONNREFUSED () { 111 }
145 sub EADDRINUSE () { 112 }
146 sub ECONNABORTED () { 113 }
147 sub ENETUNREACH () { 114 }
148 sub ENETDOWN () { 115 }
149 sub ETIMEDOUT () { 116 }
150 sub EHOSTDOWN () { 117 }
151 sub EHOSTUNREACH () { 118 }
152 sub EINPROGRESS () { 119 }
153 sub EALREADY () { 120 }
154 sub EDESTADDRREQ () { 121 }
155 sub EMSGSIZE () { 122 }
156 sub EPROTONOSUPPORT () { 123 }
157 sub ESOCKTNOSUPPORT () { 124 }
158 sub EADDRNOTAVAIL () { 125 }
159 sub ENETRESET () { 126 }
160 sub EISCONN () { 127 }
161 sub ENOTCONN () { 128 }
162 sub ETOOMANYREFS () { 129 }
163 sub EPROCLIM () { 130 }
164 sub EUSERS () { 131 }
165 sub EDQUOT () { 132 }
166 sub ESTALE () { 133 }
167 sub ENOTSUP () { 134 }
168 sub ENOMEDIUM () { 135 }
169 sub ENOSHARE () { 136 }
170 sub ECASECLASH () { 137 }
172 sub TIEHASH { bless [] }
174 sub FETCH {
175 my ($self, $errname) = @_;
176 my $proto = prototype("Errno::$errname");
177 my $errno = "";
178 if (defined($proto) && $proto eq "") {
179 no strict 'refs';
180 $errno = &$errname;
181 $errno = 0 unless $! == $errno;
183 return $errno;
186 sub STORE {
187 require Carp;
188 Carp::confess("ERRNO hash is read only!");
191 *CLEAR = \&STORE;
192 *DELETE = \&STORE;
194 sub NEXTKEY {
195 my($k,$v);
196 while(($k,$v) = each %Errno::) {
197 my $proto = prototype("Errno::$k");
198 last if (defined($proto) && $proto eq "");
203 sub FIRSTKEY {
204 my $s = scalar keys %Errno::; # initialize iterator
205 goto &NEXTKEY;
208 sub EXISTS {
209 my ($self, $errname) = @_;
210 my $r = ref $errname;
211 my $proto = !$r || $r eq 'CODE' ? prototype($errname) : undef;
212 defined($proto) && $proto eq "";
215 tie %!, __PACKAGE__;
218 __END__
220 =head1 NAME
222 Errno - System errno constants
224 =head1 SYNOPSIS
226 use Errno qw(EINTR EIO :POSIX);
228 =head1 DESCRIPTION
230 C<Errno> defines and conditionally exports all the error constants
231 defined in your system C<errno.h> include file. It has a single export
232 tag, C<:POSIX>, which will export all POSIX defined error numbers.
234 C<Errno> also makes C<%!> magic such that each element of C<%!> has a
235 non-zero value only if C<$!> is set to that value. For example:
237 use Errno;
239 unless (open(FH, "/fangorn/spouse")) {
240 if ($!{ENOENT}) {
241 warn "Get a wife!\n";
242 } else {
243 warn "This path is barred: $!";
247 If a specified constant C<EFOO> does not exist on the system, C<$!{EFOO}>
248 returns C<"">. You may use C<exists $!{EFOO}> to check whether the
249 constant is available on the system.
251 =head1 CAVEATS
253 Importing a particular constant may not be very portable, because the
254 import will fail on platforms that do not have that constant. A more
255 portable way to set C<$!> to a valid value is to use:
257 if (exists &Errno::EFOO) {
258 $! = &Errno::EFOO;
261 =head1 AUTHOR
263 Graham Barr <gbarr@pobox.com>
265 =head1 COPYRIGHT
267 Copyright (c) 1997-8 Graham Barr. All rights reserved.
268 This program is free software; you can redistribute it and/or modify it
269 under the same terms as Perl itself.
271 =cut