Source code of Windows XP (NT5)
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.

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