diff options
Diffstat (limited to 'ext/Fcntl/Fcntl.pm')
-rw-r--r-- | ext/Fcntl/Fcntl.pm | 163 |
1 files changed, 16 insertions, 147 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 8758359532..8ce761c50b 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -175,156 +175,25 @@ $VERSION = "1.03"; S_IRGRP S_IWGRP S_IXGRP S_IRWXG S_IROTH S_IWOTH S_IXOTH S_IRWXO S_IREAD S_IWRITE S_IEXEC - &S_ISREG &S_ISDIR &S_ISLNK &S_ISSOCK - &S_ISBLK &S_ISCHR &S_ISFIFO - &S_ISWHT &S_ISENFMT - &S_IFMT &S_IMODE + S_ISREG S_ISDIR S_ISLNK S_ISSOCK + S_ISBLK S_ISCHR S_ISFIFO + S_ISWHT S_ISENFMT + S_IFMT S_IMODE )], ); -sub FD_CLOEXEC (); +sub S_IFMT { @_ ? ( $_[0] & _S_IFMT() ) : _S_IFMT() } +sub S_IMODE { $_[0] & 07777 } -sub F_ALLOCSP (); -sub F_ALLOCSP64 (); -sub F_COMPAT (); -sub F_DUP2FD (); -sub F_DUPFD (); -sub F_EXLCK (); -sub F_FREESP (); -sub F_FREESP64 (); -sub F_FSYNC (); -sub F_FSYNC64 (); -sub F_GETFD (); -sub F_GETFL (); -sub F_GETLK (); -sub F_GETLK64 (); -sub F_GETOWN (); -sub F_NODNY (); -sub F_POSIX (); -sub F_RDACC (); -sub F_RDDNY (); -sub F_RDLCK (); -sub F_RWACC (); -sub F_RWDNY (); -sub F_SETFD (); -sub F_SETFL (); -sub F_SETLK (); -sub F_SETLK64 (); -sub F_SETLKW (); -sub F_SETLKW64 (); -sub F_SETOWN (); -sub F_SHARE (); -sub F_SHLCK (); -sub F_UNLCK (); -sub F_UNSHARE (); -sub F_WRACC (); -sub F_WRDNY (); -sub F_WRLCK (); - -sub O_ACCMODE (); -sub O_ALIAS (); -sub O_APPEND (); -sub O_ASYNC (); -sub O_BINARY (); -sub O_CREAT (); -sub O_DEFER (); -sub O_DIRECT (); -sub O_DIRECTORY (); -sub O_DSYNC (); -sub O_EXCL (); -sub O_EXLOCK (); -sub O_LARGEFILE (); -sub O_NDELAY (); -sub O_NOCTTY (); -sub O_NOFOLLOW (); -sub O_NONBLOCK (); -sub O_RDONLY (); -sub O_RDWR (); -sub O_RSRC (); -sub O_RSYNC (); -sub O_SHLOCK (); -sub O_SYNC (); -sub O_TEMPORARY (); -sub O_TEXT (); -sub O_TRUNC (); -sub O_WRONLY (); - -sub FAPPEND (); -sub FASYNC (); -sub FCREAT (); -sub FDEFER (); -sub FDSYNC (); -sub FEXCL (); -sub FLARGEFILE (); -sub FNDELAY (); -sub FNONBLOCK (); -sub FRSYNC (); -sub FSYNC (); -sub FTRUNC (); - -sub LOCK_EX (); -sub LOCK_NB (); -sub LOCK_SH (); -sub LOCK_UN (); - -sub SEEK_SET (); -sub SEEK_CUR (); -sub SEEK_END (); - -sub S_ISUID (); -sub S_ISGID (); -sub S_ISVTX (); -sub S_ISTXT (); -sub _S_IFMT (); -sub S_IFMT (;$); -sub S_IMODE ($); -sub S_IFREG (); -sub S_IFDIR (); -sub S_IFLNK (); -sub S_IFSOCK (); -sub S_IFBLK (); -sub S_IFCHR (); -sub S_IFIFO (); -sub S_IFWHT (); -sub S_ENFMT (); -sub S_IRUSR (); -sub S_IWUSR (); -sub S_IXUSR (); -sub S_IRWXU (); -sub S_IRGRP (); -sub S_IWGRP (); -sub S_IXGRP (); -sub S_IRWXG (); -sub S_IROTH (); -sub S_IWOTH (); -sub S_IXOTH (); -sub S_IRWXO (); -sub S_IREAD (); -sub S_IWRITE (); -sub S_IEXEC (); - -sub S_IFREG (); -sub S_IFDIR (); -sub S_IFLNK (); -sub S_IFSOCK (); -sub S_IFBLK (); -sub S_IFCHR (); -sub S_IFIFO (); -sub S_IFWHT (); -sub S_IFENFMT (); - -sub S_IFMT (;$) { @_ ? ( $_[0] & _S_IFMT ) : _S_IFMT } -sub S_IMODE ($) { $_[0] & 07777 } - -sub S_ISREG ($) { ( $_[0] & _S_IFMT ) == S_IFREG } -sub S_ISDIR ($) { ( $_[0] & _S_IFMT ) == S_IFDIR } -sub S_ISLNK ($) { ( $_[0] & _S_IFMT ) == S_IFLNK } -sub S_ISSOCK ($) { ( $_[0] & _S_IFMT ) == S_IFSOCK } -sub S_ISBLK ($) { ( $_[0] & _S_IFMT ) == S_IFBLK } -sub S_ISCHR ($) { ( $_[0] & _S_IFMT ) == S_IFCHR } -sub S_ISFIFO ($) { ( $_[0] & _S_IFMT ) == S_IFIFO } -sub S_ISWHT ($) { ( $_[0] & _S_IFMT ) == S_ISWHT } -sub S_ISENFMT ($) { ( $_[0] & _S_IFMT ) == S_ISENFMT } +sub S_ISREG { ( $_[0] & _S_IFMT() ) == S_IFREG() } +sub S_ISDIR { ( $_[0] & _S_IFMT() ) == S_IFDIR() } +sub S_ISLNK { ( $_[0] & _S_IFMT() ) == S_IFLNK() } +sub S_ISSOCK { ( $_[0] & _S_IFMT() ) == S_IFSOCK() } +sub S_ISBLK { ( $_[0] & _S_IFMT() ) == S_IFBLK() } +sub S_ISCHR { ( $_[0] & _S_IFMT() ) == S_IFCHR() } +sub S_ISFIFO { ( $_[0] & _S_IFMT() ) == S_IFIFO() } +sub S_ISWHT { ( $_[0] & _S_IFMT() ) == S_ISWHT() } +sub S_ISENFMT { ( $_[0] & _S_IFMT() ) == S_ISENFMT() } sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; @@ -340,7 +209,7 @@ sub AUTOLOAD { "; } } - *$AUTOLOAD = sub () { $val }; + *$AUTOLOAD = sub { $val }; goto &$AUTOLOAD; } |