Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
4.1 KiB

  1. #
  2. # This file is auto-generated. ***ANY*** changes here will be lost
  3. #
  4. package Errno;
  5. use vars qw(@EXPORT_OK %EXPORT_TAGS @ISA $VERSION %errno $AUTOLOAD);
  6. use Exporter ();
  7. use Config;
  8. use strict;
  9. "$Config{'archname'}-$Config{'osvers'}" eq
  10. "MSWin32-x86-multi-thread-4.0" or
  11. die "Errno architecture (MSWin32-x86-multi-thread-4.0) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";
  12. $VERSION = "1.111";
  13. @ISA = qw(Exporter);
  14. @EXPORT_OK = qw(ENFILE EACCES EPERM EPIPE ERANGE ENOSPC ESPIPE
  15. EDEADLOCK ENOMEM ENOTTY ENOSYS EAGAIN EXDEV ECHILD ENOTDIR ESRCH
  16. EISDIR EROFS EEXIST ENODEV EBADF EMLINK EINVAL ENOLCK ENXIO
  17. ENAMETOOLONG E2BIG EBUSY ENOENT EINTR ENOTEMPTY EDOM EDEADLK EIO
  18. EFAULT EFBIG ENOEXEC EMFILE EILSEQ);
  19. %EXPORT_TAGS = (
  20. POSIX => [qw(
  21. E2BIG EACCES EAGAIN EBADF EBUSY ECHILD EDEADLK EDOM EEXIST EFAULT
  22. EFBIG EINTR EINVAL EIO EISDIR EMFILE EMLINK ENAMETOOLONG ENFILE ENODEV
  23. ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS ENOTDIR ENOTEMPTY ENOTTY
  24. ENXIO EPERM EPIPE ERANGE EROFS ESPIPE ESRCH EXDEV
  25. )]
  26. );
  27. sub EPERM () { 1 }
  28. sub ENOENT () { 2 }
  29. sub ESRCH () { 3 }
  30. sub EINTR () { 4 }
  31. sub EIO () { 5 }
  32. sub ENXIO () { 6 }
  33. sub E2BIG () { 7 }
  34. sub ENOEXEC () { 8 }
  35. sub EBADF () { 9 }
  36. sub ECHILD () { 10 }
  37. sub EAGAIN () { 11 }
  38. sub ENOMEM () { 12 }
  39. sub EACCES () { 13 }
  40. sub EFAULT () { 14 }
  41. sub EBUSY () { 16 }
  42. sub EEXIST () { 17 }
  43. sub EXDEV () { 18 }
  44. sub ENODEV () { 19 }
  45. sub ENOTDIR () { 20 }
  46. sub EISDIR () { 21 }
  47. sub EINVAL () { 22 }
  48. sub ENFILE () { 23 }
  49. sub EMFILE () { 24 }
  50. sub ENOTTY () { 25 }
  51. sub EFBIG () { 27 }
  52. sub ENOSPC () { 28 }
  53. sub ESPIPE () { 29 }
  54. sub EROFS () { 30 }
  55. sub EMLINK () { 31 }
  56. sub EPIPE () { 32 }
  57. sub EDOM () { 33 }
  58. sub ERANGE () { 34 }
  59. sub EDEADLK () { 36 }
  60. sub EDEADLOCK () { 36 }
  61. sub ENAMETOOLONG () { 38 }
  62. sub ENOLCK () { 39 }
  63. sub ENOSYS () { 40 }
  64. sub ENOTEMPTY () { 41 }
  65. sub EILSEQ () { 42 }
  66. sub TIEHASH { bless [] }
  67. sub FETCH {
  68. my ($self, $errname) = @_;
  69. my $proto = prototype("Errno::$errname");
  70. my $errno = "";
  71. if (defined($proto) && $proto eq "") {
  72. no strict 'refs';
  73. $errno = &$errname;
  74. $errno = 0 unless $! == $errno;
  75. }
  76. return $errno;
  77. }
  78. sub STORE {
  79. require Carp;
  80. Carp::confess("ERRNO hash is read only!");
  81. }
  82. *CLEAR = \&STORE;
  83. *DELETE = \&STORE;
  84. sub NEXTKEY {
  85. my($k,$v);
  86. while(($k,$v) = each %Errno::) {
  87. my $proto = prototype("Errno::$k");
  88. last if (defined($proto) && $proto eq "");
  89. }
  90. $k
  91. }
  92. sub FIRSTKEY {
  93. my $s = scalar keys %Errno::; # initialize iterator
  94. goto &NEXTKEY;
  95. }
  96. sub EXISTS {
  97. my ($self, $errname) = @_;
  98. my $proto = prototype($errname);
  99. defined($proto) && $proto eq "";
  100. }
  101. tie %!, __PACKAGE__;
  102. 1;
  103. __END__
  104. =head1 NAME
  105. Errno - System errno constants
  106. =head1 SYNOPSIS
  107. use Errno qw(EINTR EIO :POSIX);
  108. =head1 DESCRIPTION
  109. C<Errno> defines and conditionally exports all the error constants
  110. defined in your system C<errno.h> include file. It has a single export
  111. tag, C<:POSIX>, which will export all POSIX defined error numbers.
  112. C<Errno> also makes C<%!> magic such that each element of C<%!> has a
  113. non-zero value only if C<$!> is set to that value. For example:
  114. use Errno;
  115. unless (open(FH, "/fangorn/spouse")) {
  116. if ($!{ENOENT}) {
  117. warn "Get a wife!\n";
  118. } else {
  119. warn "This path is barred: $!";
  120. }
  121. }
  122. If a specified constant C<EFOO> does not exist on the system, C<$!{EFOO}>
  123. returns C<"">. You may use C<exists $!{EFOO}> to check whether the
  124. constant is available on the system.
  125. =head1 CAVEATS
  126. Importing a particular constant may not be very portable, because the
  127. import will fail on platforms that do not have that constant. A more
  128. portable way to set C<$!> to a valid value is to use:
  129. if (exists &Errno::EFOO) {
  130. $! = &Errno::EFOO;
  131. }
  132. =head1 AUTHOR
  133. Graham Barr <[email protected]>
  134. =head1 COPYRIGHT
  135. Copyright (c) 1997-8 Graham Barr. All rights reserved.
  136. This program is free software; you can redistribute it and/or modify it
  137. under the same terms as Perl itself.
  138. =cut