@EXPORT =
qw(
FD_CLOEXEC
+ F_ALLOCSP
+ F_ALLOCSP64
+ F_COMPAT
+ F_DUP2FD
F_DUPFD
F_EXLCK
+ F_FREESP
+ F_FREESP64
+ F_FSYNC
+ F_FSYNC64
F_GETFD
F_GETFL
F_GETLK
F_GETLK64
F_GETOWN
+ F_NODNY
F_POSIX
+ F_RDACC
+ F_RDDNY
F_RDLCK
+ F_RWACC
+ F_RWDNY
F_SETFD
F_SETFL
F_SETLK
F_SETLKW
F_SETLKW64
F_SETOWN
+ F_SHARE
F_SHLCK
F_UNLCK
+ F_UNSHARE
+ F_WRACC
+ F_WRDNY
F_WRLCK
O_ACCMODE
O_APPEND
O_TEXT
O_TRUNC
O_WRONLY
+ SEEK_SET
+ SEEK_CUR
+ SEEK_END
);
# Other items we are prepared to export if requested
FASYNC
FCREAT
FDEFER
+ FDSYNC
FEXCL
+ FLARGEFILE
FNDELAY
FNONBLOCK
+ FRSYNC
FSYNC
FTRUNC
LOCK_EX
# Named groups of exports
%EXPORT_TAGS = (
'flock' => [qw(LOCK_SH LOCK_EX LOCK_NB LOCK_UN)],
- 'Fcompat' => [qw(FAPPEND FASYNC FCREAT FDEFER FEXCL
- FNDELAY FNONBLOCK FSYNC FTRUNC)],
+ 'Fcompat' => [qw(FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE
+ FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC)],
);
sub AUTOLOAD {
#endif
#endif
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+
/* This comment is a kludge to get metaconfig to see the symbols
VAL_O_NONBLOCK
VAL_EAGAIN
switch (*name) {
case 'F':
if (strnEQ(name, "F_", 2)) {
+ if (strEQ(name, "F_ALLOCSP"))
+#ifdef F_ALLOCSP
+ return F_ALLOCSP;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_ALLOCSP64"))
+#ifdef F_ALLOCSP64
+ return F_ALLOCSP64;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_COMPAT"))
+#ifdef F_COMPAT
+ return F_COMPAT;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_DUP2FD"))
+#ifdef F_DUP2FD
+ return F_DUP2FD;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_DUPFD"))
#ifdef F_DUPFD
return F_DUPFD;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_FREESP"))
+#ifdef F_FREESP
+ return F_FREESP;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_FREESP64"))
+#ifdef F_FREESP64
+ return F_FREESP64;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_FSYNC"))
+#ifdef F_FSYNC
+ return F_FSYNC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_FSYNC64"))
+#ifdef F_FSYNC64
+ return F_FSYNC64;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_GETFD"))
#ifdef F_GETFD
return F_GETFD;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_NODNY"))
+#ifdef F_NODNY
+ return F_NODNY;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_POSIX"))
#ifdef F_POSIX
return F_POSIX;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_RDACC"))
+#ifdef F_RDACC
+ return F_RDACC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_RDDNY"))
+#ifdef F_RDDNY
+ return F_RDDNY;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_RDLCK"))
#ifdef F_RDLCK
return F_RDLCK;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_RWACC"))
+#ifdef F_RWACC
+ return F_RWACC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_RWDNY"))
+#ifdef F_RWDNY
+ return F_RWDNY;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_SETFD"))
#ifdef F_SETFD
return F_SETFD;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_SHARE"))
+#ifdef F_SHARE
+ return F_SHARE;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_SHLCK"))
#ifdef F_SHLCK
return F_SHLCK;
#else
goto not_there;
#endif
+ if (strEQ(name, "F_UNSHARE"))
+#ifdef F_UNSHARE
+ return F_UNSHARE;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_WRACC"))
+#ifdef F_WRACC
+ return F_WRACC;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "F_WRDNY"))
+#ifdef F_WRDNY
+ return F_WRDNY;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_WRLCK"))
#ifdef F_WRLCK
return F_WRLCK;
#else
goto not_there;
#endif
+ if (strEQ(name, "FDSYNC"))
+#ifdef FDSYNC
+ return FDSYNC;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "FEXCL"))
#ifdef FEXCL
return FEXCL;
#else
goto not_there;
#endif
+ if (strEQ(name, "FLARGEFILE"))
+#ifdef FLARGEFILE
+ return FLARGEFILE;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "FNDELAY"))
#ifdef FNDELAY
return FNDELAY;
#else
goto not_there;
#endif
+ if (strEQ(name, "FRSYNC"))
+#ifdef FRSYNC
+ return FRSYNC;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "FSYNC"))
#ifdef FSYNC
return FSYNC;
} else
goto not_there;
break;
+ case 'S':
+ if (strEQ(name, "SEEK_CUR"))
+#ifdef SEEK_CUR
+ return SEEK_CUR;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "SEEK_END"))
+#ifdef SEEK_END
+ return SEEK_END;
+#else
+ goto not_there;
+#endif
+ if (strEQ(name, "SEEK_SET"))
+#ifdef SEEK_SET
+ return SEEK_SET;
+#else
+ goto not_there;
+#endif
+ break;
}
errno = EINVAL;
return 0;
Sets FILEHANDLE's position, just like the C<fseek> call of C<stdio>.
FILEHANDLE may be an expression whose value gives the name of the
filehandle. The values for WHENCE are C<0> to set the new position to
-POSITION, C<1> to set it to the current position plus POSITION, and C<2> to
-set it to EOF plus POSITION (typically negative). For WHENCE you may
-use the constants C<SEEK_SET>, C<SEEK_CUR>, and C<SEEK_END> from either the
-C<IO::Seekable> or the POSIX module. Returns C<1> upon success, C<0> otherwise.
+POSITION, C<1> to set it to the current position plus POSITION, and
+C<2> to set it to EOF plus POSITION (typically negative). For WHENCE
+you may use the constants C<SEEK_SET>, C<SEEK_CUR>, and C<SEEK_END>
+(start of the file, current position, end of the file) from any of the
+modules Fcntl, C<IO::Seekable>, or POSIX. Returns C<1> upon success,
+C<0> otherwise.
If you want to position file for C<sysread> or C<syswrite>, don't use
C<seek>--buffering makes its effect on the file's system position
Sets FILEHANDLE's system position using the system call lseek(2). It
bypasses stdio, so mixing this with reads (other than C<sysread>),
-C<print>, C<write>, C<seek>, C<tell>, or C<eof> may cause
-confusion. FILEHANDLE may be an expression whose value gives the name
-of the filehandle. The values for WHENCE are C<0> to set the new
-position to POSITION, C<1> to set the it to the current position plus
-POSITION, and C<2> to set it to EOF plus POSITION (typically negative).
-For WHENCE, you may use the constants C<SEEK_SET>, C<SEEK_CUR>, and
-C<SEEK_END> from either the C<IO::Seekable> or the POSIX module.
+C<print>, C<write>, C<seek>, C<tell>, or C<eof> may cause confusion.
+FILEHANDLE may be an expression whose value gives the name of the
+filehandle. The values for WHENCE are C<0> to set the new position to
+POSITION, C<1> to set the it to the current position plus POSITION,
+and C<2> to set it to EOF plus POSITION (typically negative). For
+WHENCE, you may also use the constants C<SEEK_SET>, C<SEEK_CUR>, and
+C<SEEK_END> (start of the file, current position, end of the file)
+from any of the modules Fcntl, C<IO::Seekable>, or POSIX.
Returns the new position, or the undefined value on failure. A position
of zero is returned as the string C<"0 but true">; thus C<sysseek> returns