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