This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.000 patch.0n: [address Configure and build issues]
[perl5.git] / ext / Fcntl / Fcntl.pm
CommitLineData
a0d0e21e
LW
1package Fcntl;
2
3require Exporter;
4require AutoLoader;
5require DynaLoader;
3edbfbe5 6@ISA = (Exporter, DynaLoader);
a0d0e21e
LW
7# Items to export into callers namespace by default
8# (move infrequently used names to @EXPORT_OK below)
9@EXPORT =
10 qw(
11 F_DUPFD F_GETFD F_GETLK F_SETFD F_GETFL F_SETFL F_SETLK F_SETLKW
12 FD_CLOEXEC F_RDLCK F_UNLCK F_WRLCK
13 O_CREAT O_EXCL O_NOCTTY O_TRUNC
14 O_APPEND O_NONBLOCK
15 O_NDELAY
16 O_RDONLY O_RDWR O_WRONLY
17 );
18# Other items we are prepared to export if requested
19@EXPORT_OK = qw(
20);
21
22sub AUTOLOAD {
23 if (@_ > 1) {
24 $AutoLoader::AUTOLOAD = $AUTOLOAD;
25 goto &AutoLoader::AUTOLOAD;
26 }
27 local($constname);
28 ($constname = $AUTOLOAD) =~ s/.*:://;
29 $val = constant($constname, @_ ? $_[0] : 0);
30 if ($! != 0) {
31 if ($! =~ /Invalid/) {
32 $AutoLoader::AUTOLOAD = $AUTOLOAD;
33 goto &AutoLoader::AUTOLOAD;
34 }
35 else {
36 ($pack,$file,$line) = caller;
37 die "Your vendor has not defined Fcntl macro $constname, used at $file line $line.
38";
39 }
40 }
41 eval "sub $AUTOLOAD { $val }";
42 goto &$AUTOLOAD;
43}
44
45bootstrap Fcntl;
46
47# Preloaded methods go here. Autoload methods go after __END__, and are
48# processed by the autosplit program.
49package Fcntl; # return to package Fcntl so AutoSplit is happy
501;
51__END__