← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:15 2017

Filename/usr/local/perls/perl-5.26.1/lib/5.26.1/darwin-2level/Errno.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs16µsErrno::::EEXISTErrno::EEXIST (xsub)
0000s0sErrno::::BEGINErrno::BEGIN
0000s0sErrno::::EXISTSErrno::EXISTS
0000s0sErrno::::FETCHErrno::FETCH
0000s0sErrno::::FIRSTKEYErrno::FIRSTKEY
0000s0sErrno::::NEXTKEYErrno::NEXTKEY
0000s0sErrno::::STOREErrno::STORE
0000s0sErrno::::TIEHASHErrno::TIEHASH
0000s0sErrno::::_tie_itErrno::_tie_it
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# -*- buffer-read-only: t -*-
2#
3# This file is auto-generated by ext/Errno/Errno_pm.PL.
4# ***ANY*** changes here will be lost.
5#
6
7package Errno;
8require Exporter;
9use strict;
10
11use Config;
12"$Config{'archname'}-$Config{'osvers'}" eq
13"darwin-2level-17.2.0" or
14 die "Errno architecture (darwin-2level-17.2.0) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";
15
16our $VERSION = "1.28";
17$VERSION = eval $VERSION;
18our @ISA = 'Exporter';
19
20my %err;
21
22BEGIN {
23 %err = (
24 EPERM => 1,
25 ENOENT => 2,
26 ESRCH => 3,
27 EINTR => 4,
28 EIO => 5,
29 ENXIO => 6,
30 E2BIG => 7,
31 ENOEXEC => 8,
32 EBADF => 9,
33 ECHILD => 10,
34 EDEADLK => 11,
35 ENOMEM => 12,
36 EACCES => 13,
37 EFAULT => 14,
38 ENOTBLK => 15,
39 EBUSY => 16,
40 EEXIST => 17,
41 EXDEV => 18,
42 ENODEV => 19,
43 ENOTDIR => 20,
44 EISDIR => 21,
45 EINVAL => 22,
46 ENFILE => 23,
47 EMFILE => 24,
48 ENOTTY => 25,
49 ETXTBSY => 26,
50 EFBIG => 27,
51 ENOSPC => 28,
52 ESPIPE => 29,
53 EROFS => 30,
54 EMLINK => 31,
55 EPIPE => 32,
56 EDOM => 33,
57 ERANGE => 34,
58 EAGAIN => 35,
59 EWOULDBLOCK => 35,
60 EINPROGRESS => 36,
61 EALREADY => 37,
62 ENOTSOCK => 38,
63 EDESTADDRREQ => 39,
64 EMSGSIZE => 40,
65 EPROTOTYPE => 41,
66 ENOPROTOOPT => 42,
67 EPROTONOSUPPORT => 43,
68 ESOCKTNOSUPPORT => 44,
69 ENOTSUP => 45,
70 EPFNOSUPPORT => 46,
71 EAFNOSUPPORT => 47,
72 EADDRINUSE => 48,
73 EADDRNOTAVAIL => 49,
74 ENETDOWN => 50,
75 ENETUNREACH => 51,
76 ENETRESET => 52,
77 ECONNABORTED => 53,
78 ECONNRESET => 54,
79 ENOBUFS => 55,
80 EISCONN => 56,
81 ENOTCONN => 57,
82 ESHUTDOWN => 58,
83 ETOOMANYREFS => 59,
84 ETIMEDOUT => 60,
85 ECONNREFUSED => 61,
86 ELOOP => 62,
87 ENAMETOOLONG => 63,
88 EHOSTDOWN => 64,
89 EHOSTUNREACH => 65,
90 ENOTEMPTY => 66,
91 EPROCLIM => 67,
92 EUSERS => 68,
93 EDQUOT => 69,
94 ESTALE => 70,
95 EREMOTE => 71,
96 EBADRPC => 72,
97 ERPCMISMATCH => 73,
98 EPROGUNAVAIL => 74,
99 EPROGMISMATCH => 75,
100 EPROCUNAVAIL => 76,
101 ENOLCK => 77,
102 ENOSYS => 78,
103 EFTYPE => 79,
104 EAUTH => 80,
105 ENEEDAUTH => 81,
106 EPWROFF => 82,
107 EDEVERR => 83,
108 EOVERFLOW => 84,
109 EBADEXEC => 85,
110 EBADARCH => 86,
111 ESHLIBVERS => 87,
112 EBADMACHO => 88,
113 ECANCELED => 89,
114 EIDRM => 90,
115 ENOMSG => 91,
116 EILSEQ => 92,
117 ENOATTR => 93,
118 EBADMSG => 94,
119 EMULTIHOP => 95,
120 ENODATA => 96,
121 ENOLINK => 97,
122 ENOSR => 98,
123 ENOSTR => 99,
124 EPROTO => 100,
125 ETIME => 101,
126 EOPNOTSUPP => 102,
127 ENOPOLICY => 103,
128 ENOTRECOVERABLE => 104,
129 EOWNERDEAD => 105,
130 ELAST => 106,
131 EQFULL => 106,
132 );
133 # Generate proxy constant subroutines for all the values.
134 # Well, almost all the values. Unfortunately we can't assume that at this
135 # point that our symbol table is empty, as code such as if the parser has
136 # seen code such as C<exists &Errno::EINVAL>, it will have created the
137 # typeglob.
138 # Doing this before defining @EXPORT_OK etc means that even if a platform is
139 # crazy enough to define EXPORT_OK as an error constant, everything will
140 # still work, because the parser will upgrade the PCS to a real typeglob.
141 # We rely on the subroutine definitions below to update the internal caches.
142 # Don't use %each, as we don't want a copy of the value.
143 foreach my $name (keys %err) {
144 if ($Errno::{$name}) {
145 # We expect this to be reached fairly rarely, so take an approach
146 # which uses the least compile time effort in the common case:
147 eval "sub $name() { $err{$name} }; 1" or die $@;
148 } else {
149 $Errno::{$name} = \$err{$name};
150 }
151 }
152}
153
154our @EXPORT_OK = keys %err;
155
156our %EXPORT_TAGS = (
157 POSIX => [qw(
158 E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY
159 EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
160 EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH
161 EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
162 EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS
163 ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK
164 ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
165 EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE
166 EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT
167 ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV
168 )],
169);
170
171sub TIEHASH { bless \%err }
172
173sub FETCH {
174 my (undef, $errname) = @_;
175 return "" unless exists $err{$errname};
176 my $errno = $err{$errname};
177 return $errno == $! ? $errno : 0;
178}
179
180sub STORE {
181 require Carp;
182 Carp::confess("ERRNO hash is read only!");
183}
184
185# This is the true return value
186*CLEAR = *DELETE = \*STORE; # Typeglob aliasing uses less space
187
188sub NEXTKEY {
189 each %err;
190}
191
192sub FIRSTKEY {
193 my $s = scalar keys %err; # initialize iterator
194 each %err;
195}
196
197sub EXISTS {
198 my (undef, $errname) = @_;
199 exists $err{$errname};
200}
201
202sub _tie_it {
203 tie %{$_[0]}, __PACKAGE__;
204}
205
206__END__
207
208=head1 NAME
209
210Errno - System errno constants
211
212=head1 SYNOPSIS
213
214 use Errno qw(EINTR EIO :POSIX);
215
216=head1 DESCRIPTION
217
218C<Errno> defines and conditionally exports all the error constants
219defined in your system F<errno.h> include file. It has a single export
220tag, C<:POSIX>, which will export all POSIX defined error numbers.
221
222On Windows, C<Errno> also defines and conditionally exports all the
223Winsock error constants defined in your system F<WinError.h> include
224file. These are included in a second export tag, C<:WINSOCK>.
225
226C<Errno> also makes C<%!> magic such that each element of C<%!> has a
227non-zero value only if C<$!> is set to that value. For example:
228
229 my $fh;
230 unless (open($fh, "<", "/fangorn/spouse")) {
231 if ($!{ENOENT}) {
232 warn "Get a wife!\n";
233 } else {
234 warn "This path is barred: $!";
235 }
236 }
237
238If a specified constant C<EFOO> does not exist on the system, C<$!{EFOO}>
239returns C<"">. You may use C<exists $!{EFOO}> to check whether the
240constant is available on the system.
241
242Perl automatically loads C<Errno> the first time you use C<%!>, so you don't
243need an explicit C<use>.
244
245=head1 CAVEATS
246
247Importing a particular constant may not be very portable, because the
248import will fail on platforms that do not have that constant. A more
249portable way to set C<$!> to a valid value is to use:
250
251 if (exists &Errno::EFOO) {
252 $! = &Errno::EFOO;
253 }
254
255=head1 AUTHOR
256
257Graham Barr <[email protected]>
258
259=head1 COPYRIGHT
260
261Copyright (c) 1997-8 Graham Barr. All rights reserved.
262This program is free software; you can redistribute it and/or modify it
263under the same terms as Perl itself.
264
265=cut
266
267# ex: set ro:
 
# spent 16µs within Errno::EEXIST which was called: # once (16µs+0s) by CPAN::Distribution::run_preps_on_packagedir at line 562 of CPAN/Distribution.pm
sub Errno::EEXIST; # xsub