Commit 4ffcb70c authored by Utkarsh Gupta's avatar Utkarsh Gupta

Update upstream source from tag 'upstream/4.72'

Update to upstream version '4.72'
with Debian dir de48edd1c7238917ef36f3acb83c0891a8d234f4
parents 93d9df51 0ef85c32
......@@ -173,7 +173,7 @@ use common::sense;
use base 'Exporter';
BEGIN {
our $VERSION = 4.6;
our $VERSION = 4.72;
our @AIO_REQ = qw(aio_sendfile aio_seek aio_read aio_write aio_open aio_close
aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
......@@ -280,11 +280,14 @@ documentation.
IO::AIO::nreqs
IO::AIO::nready
IO::AIO::npending
IO::AIO::reinit
$nfd = IO::AIO::get_fdlimit [EXPERIMENTAL]
IO::AIO::min_fdlimit $nfd [EXPERIMENTAL]
IO::AIO::sendfile $ofh, $ifh, $offset, $count
IO::AIO::fadvise $fh, $offset, $len, $advice
IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]]
IO::AIO::munmap $scalar
IO::AIO::mremap $scalar, $new_length, $flags[, $new_address]
......@@ -293,6 +296,25 @@ documentation.
IO::AIO::munlock $scalar, $offset = 0, $length = undef
IO::AIO::munlockall
# stat extensions
$counter = IO::AIO::st_gen
$seconds = IO::AIO::st_atime, IO::AIO::st_mtime, IO::AIO::st_ctime, IO::AIO::st_btime
($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtime
$nanoseconds = IO::AIO::st_atimensec, IO::AIO::st_mtimensec, IO::AIO::st_ctimensec, IO::AIO::st_btimensec
$seconds = IO::AIO::st_btimesec
($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec
# very much unportable syscalls
IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags
IO::AIO::tee $r_fh, $w_fh, $length, $flags
$actual_size = IO::AIO::pipesize $r_fh[, $new_size]
($rfh, $wfh) = IO::AIO::pipe2 [$flags]
$fh = IO::AIO::memfd_create $pathname[, $flags]
$fh = IO::AIO::eventfd [$initval, [$flags]]
$fh = IO::AIO::timerfd_create $clockid[, $flags]
($cur_interval, $cur_value) = IO::AIO::timerfd_settime $fh, $flags, $new_interval, $nbw_value
($cur_interval, $cur_value) = IO::AIO::timerfd_gettime $fh
=head2 API NOTES
All the C<aio_*> calls are more or less thin wrappers around the syscall
......@@ -1111,13 +1133,69 @@ sub aio_scandir($$;$) {
return $grp->result () if $_[0];
my $now = time;
my $hash1 = join ":", (stat _)[0,1,3,7,9];
my $rdxflags = READDIR_DIRS_FIRST;
if ((stat _)[3] < 2) {
# at least one non-POSIX filesystem exists
# that returns useful DT_type values: btrfs,
# so optimise for this here by requesting dents
$rdxflags |= READDIR_DENTS;
}
# read the directory entries
aioreq_pri $pri;
add $grp aio_readdirx $wd, READDIR_DIRS_FIRST, sub {
my $entries = shift
add $grp aio_readdirx $wd, $rdxflags, sub {
my ($entries, $flags) = @_
or return $grp->result ();
if ($rdxflags & READDIR_DENTS) {
# if we requested type values, see if we can use them directly.
# if there were any DT_UNKNOWN entries then we assume we
# don't know. alternatively, we could assume that if we get
# one DT_DIR, then all directories are indeed marked with
# DT_DIR, but this seems not required for btrfs, and this
# is basically the "btrfs can't get it's act together" code
# branch.
unless ($flags & READDIR_FOUND_UNKNOWN) {
# now we have valid DT_ information for all entries,
# so use it as an optimisation without further stat's.
# they must also all be at the beginning of @$entries
# by now.
my $dirs;
if (@$entries) {
for (0 .. $#$entries) {
if ($entries->[$_][1] != DT_DIR) {
# splice out directories
$dirs = [splice @$entries, 0, $_];
last;
}
}
# if we didn't find any non-dir, then all entries are dirs
unless ($dirs) {
($dirs, $entries) = ($entries, []);
}
} else {
# directory is empty, so there are no sbdirs
$dirs = [];
}
# either splice'd the directories out or the dir was empty.
# convert dents to filenames
$_ = $_->[0] for @$dirs;
$_ = $_->[0] for @$entries;
return $grp->result ($dirs, $entries);
}
# cannot use, so return to our old ways
# by pretending we only scanned for names.
$_ = $_->[0] for @$entries;
}
# stat the dir another time
aioreq_pri $pri;
add $grp aio_stat $wd, sub {
......@@ -1387,11 +1465,14 @@ C<$data> gets destroyed.
=item aio_mlockall $flags, $callback->($status)
Calls the C<mlockall> function with the given C<$flags> (a combination of
C<IO::AIO::MCL_CURRENT> and C<IO::AIO::MCL_FUTURE>).
Calls the C<mlockall> function with the given C<$flags> (a
combination of C<IO::AIO::MCL_CURRENT>, C<IO::AIO::MCL_FUTURE> and
C<IO::AIO::MCL_ONFAULT>).
On systems that do not implement C<mlockall>, this function returns C<-1>
and sets errno to C<ENOSYS>.
and sets errno to C<ENOSYS>. Similarly, flag combinations not supported
by the system result in a return value of C<-1> with errno being set to
C<EINVAL>.
Note that the corresponding C<munlockall> is synchronous and is
documented under L<MISCELLANEOUS FUNCTIONS>.
......@@ -2065,7 +2146,7 @@ accuracy.
File birth time is only available when the OS and perl support it (on
FreeBSD and NetBSD at the time of this writing, although support is
adaptive, so if your OS/perl gains support, IO::AIO can take avdantage of
adaptive, so if your OS/perl gains support, IO::AIO can take advantage of
it). On systems where it isn't available, C<0> is currently returned, but
this might change to C<undef> in a future version.
......@@ -2095,11 +2176,11 @@ more in future versions).
=item $counter = IO::AIO::st_gen
Returns the generation counter of the file. This is only available on
platforms which have this member in their C<struct stat> (most BSDs
at the time of this writing) and generally only to the root usert. If
unsupported, C<0> is returned, but this might change to C<undef> in a
future version.
Returns the generation counter (in practice this is just a random number)
of the file. This is only available on platforms which have this member in
their C<struct stat> (most BSDs at the time of this writing) and generally
only to the root usert. If unsupported, C<0> is returned, but this might
change to C<undef> in a future version.
=back
......@@ -2297,6 +2378,11 @@ implemented, but not supported and might go away in a future version.
On systems where this call is not supported or is not emulated, this call
returns falls and sets C<$!> to C<ENOSYS>.
=item IO::AIO::mlockall $flags
Calls the C<eio_mlockall_sync> function, which is like C<aio_mlockall>,
but is blocking.
=item IO::AIO::munlock $scalar, $offset = 0, $length = undef
Calls the C<munlock> function, undoing the effects of a previous
......@@ -2361,6 +2447,24 @@ Example: create a pipe race-free w.r.t. threads and fork:
my ($rfh, $wfh) = IO::AIO::pipe2 IO::AIO::O_CLOEXEC
or die "pipe2: $!\n";
=item $fh = IO::AIO::memfd_create $pathname[, $flags]
This is a direct interface to the Linux L<memfd_create(2)> system
call. The (unhelpful) default for C<$flags> is C<0>, but your default
should be C<IO::AIO::MFD_CLOEXEC>.
On success, the new memfd filehandle is returned, otherwise returns
C<undef>. If the memfd_create syscall is missing, fails with C<ENOSYS>.
Please refer to L<memfd_create(2)> for more info on this call.
The following C<$flags> values are available: C<IO::AIO::MFD_CLOEXEC>,
C<IO::AIO::MFD_ALLOW_SEALING> and C<IO::AIO::MFD_HUGETLB>.
Example: create a new memfd.
my $fh = IO::AIO::memfd_create "somenameforprocfd", IO::AIO::MFD_CLOEXEC
or die "m,emfd_create: $!\n";
=item $fh = IO::AIO::eventfd [$initval, [$flags]]
This is a direct interface to the Linux L<eventfd(2)> system call. The
......@@ -2376,16 +2480,17 @@ C<IO::AIO::EFD_NONBLOCK> and C<IO::AIO::EFD_SEMAPHORE> (Linux 2.6.30).
Example: create a new eventfd filehandle:
$fh = IO::AIO::eventfd 0, IO::AIO::O_CLOEXEC
$fh = IO::AIO::eventfd 0, IO::AIO::EFD_CLOEXEC
or die "eventfd: $!\n";
=item $fh = IO::AIO::timerfd_create $clockid[, $flags]
This is a direct interface to the Linux L<timerfd_create(2)> system call. The
(unhelpful) default for C<$flags> is C<0>.
This is a direct interface to the Linux L<timerfd_create(2)> system
call. The (unhelpful) default for C<$flags> is C<0>, but your default
should be C<IO::AIO::TFD_CLOEXEC>.
On success, the new timerfd filehandle is returned, otherwise returns
C<undef>. If the eventfd syscall is missing, fails with C<ENOSYS>.
C<undef>. If the timerfd_create syscall is missing, fails with C<ENOSYS>.
Please refer to L<timerfd_create(2)> for more info on this call.
......
This diff is collapsed.
......@@ -16,7 +16,6 @@ http://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.as
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364996%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364994%28v=vs.85%29.aspx
TODO: extra socket/tcp constants &c?
TODO: http://lwn.net/Articles/593918/ SHMEM_SET_SEALS, SHMEM_GET_SEALS, SEAL_SHRINK, SEAL_GROW, SEAL_WRITE, int memfd_create(const char *name, u64 size, u64 flags);, MFD_CLOEXEC, int fd = open("/tmp", O_RDWR | O_TMPFILE | O_EXCL, S_IRWXU);
TODO: name_to_handle_At + open_by_handle_at = clone fds
TODO: lchown
TODO: mount/umount2/MS_* flags
......@@ -25,7 +24,6 @@ TODO: rewrite rmtree et al. to support working directories (also speed them up)
TODO: maybe IO::AIO leaks fds when requests are cancelled? maybe initialise result to -1?
TODO: aio_wd should use O_PATH on linux, due to lacking O_SEARCH (http://comments.gmane.org/gmane.linux.file-systems/33611)
http://www.openwall.com/lists/musl/2013/02/23/4
TODO: maybe copy some hacks from PerlIOStdio_invalidate_fileno for faster close on certain platforms
TODO: copy_file_range, copy_file_range
TODO: FIDEDUPERANGE, file_ioctl.c
TODO: mincore
......@@ -37,6 +35,32 @@ TODO: https://github.com/coreutils/coreutils/blob/master/src/stat.c maybe IO::AI
TODO: mlock2, MLOCK_ONFAULT
TODO: dup3, pipe2, accept4
TODO: dump config.log when automated testign and configure fails
TODO: ns time resolution in utime
TODO: statx
4.72 Wed Apr 3 04:56:03 CEST 2019
- (libeio) if fd 0 is available do not use it for aio_wd, as it
collides with IO::AIO::CWD.
- added IO::AIO::memfd_create.
- correctly include <sys/uio.h> in the vmsplice test.
- reduce codesize by ~7% on amd64 by declaring more functions
as noinline.
- documentation fixes and updates.
- experimental and undocumented preliminary support for synchronous statx.
4.71 Sun Mar 10 13:09:26 CET 2019
- due to an error in the linux manpages, the configure tests
for readahead, sync_file_range, splice etc. failed. This has been fixed.
4.7 Mon Mar 4 11:28:13 CET 2019
- majorly speed up scandir for the very special case of a non-POSIX
filesystem that nevertheless reports valid dt_type information.
The only known filesystem of this type is currently btrfs, which
didn't get it's act together to implement POSIX semantics in all
these years, and I am tired of waiting.
- add IO::AIO::MCL_ONFAULT for mlockall, add IO::AIO::mlockall.
- neither sys/mkdev.h nor sys/sysmacros.h were included, even when they
were detected by autoconf.
4.6 Sat Aug 25 21:58:36 CEST 2018
- add st_btime, st_btimesec, st_btimensec and st_gen accessors,
......@@ -51,7 +75,7 @@ TODO: dump config.log when automated testign and configure fails
- minor doc improvements.
- minor configure cleanups.
- use $Config{perllibs} instead of libs for configure. might help people
who didn'T install all perl dependencies (might break things as well).
who didn't install all perl dependencies (might break things as well).
4.54 Tue Aug 14 13:54:48 CEST 2018
- include sys/mkdev.h or sys/sysmacros.h if available.
......
......@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 7.32, CPAN::Meta::Converter version 2.150010",
"generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
"license" : [
"unknown"
],
......@@ -38,6 +38,6 @@
}
},
"release_status" : "stable",
"version" : 4.6,
"version" : 4.72,
"x_serialization_backend" : "JSON::PP version 2.27300"
}
......@@ -8,7 +8,7 @@ configure_requires:
Canary::Stability: '2001'
ExtUtils::MakeMaker: '6.52'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.32, CPAN::Meta::Converter version 2.150010'
generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -20,5 +20,5 @@ no_index:
- inc
requires:
common::sense: '0'
version: 4.6
version: 4.72
x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
......@@ -223,11 +223,14 @@ FUNCTIONS
IO::AIO::nreqs
IO::AIO::nready
IO::AIO::npending
IO::AIO::reinit
$nfd = IO::AIO::get_fdlimit [EXPERIMENTAL]
IO::AIO::min_fdlimit $nfd [EXPERIMENTAL]
IO::AIO::sendfile $ofh, $ifh, $offset, $count
IO::AIO::fadvise $fh, $offset, $len, $advice
IO::AIO::mmap $scalar, $length, $prot, $flags[, $fh[, $offset]]
IO::AIO::munmap $scalar
IO::AIO::mremap $scalar, $new_length, $flags[, $new_address]
......@@ -236,6 +239,25 @@ FUNCTIONS
IO::AIO::munlock $scalar, $offset = 0, $length = undef
IO::AIO::munlockall
# stat extensions
$counter = IO::AIO::st_gen
$seconds = IO::AIO::st_atime, IO::AIO::st_mtime, IO::AIO::st_ctime, IO::AIO::st_btime
($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtime
$nanoseconds = IO::AIO::st_atimensec, IO::AIO::st_mtimensec, IO::AIO::st_ctimensec, IO::AIO::st_btimensec
$seconds = IO::AIO::st_btimesec
($atime, $mtime, $ctime, $btime, ...) = IO::AIO::st_xtimensec
# very much unportable syscalls
IO::AIO::splice $r_fh, $r_off, $w_fh, $w_off, $length, $flags
IO::AIO::tee $r_fh, $w_fh, $length, $flags
$actual_size = IO::AIO::pipesize $r_fh[, $new_size]
($rfh, $wfh) = IO::AIO::pipe2 [$flags]
$fh = IO::AIO::memfd_create $pathname[, $flags]
$fh = IO::AIO::eventfd [$initval, [$flags]]
$fh = IO::AIO::timerfd_create $clockid[, $flags]
($cur_interval, $cur_value) = IO::AIO::timerfd_settime $fh, $flags, $new_interval, $nbw_value
($cur_interval, $cur_value) = IO::AIO::timerfd_gettime $fh
API NOTES
All the "aio_*" calls are more or less thin wrappers around the syscall
with the same name (sans "aio_"). The arguments are similar or
......@@ -1018,10 +1040,13 @@ FUNCTIONS
aio_mlockall $flags, $callback->($status)
Calls the "mlockall" function with the given $flags (a combination
of "IO::AIO::MCL_CURRENT" and "IO::AIO::MCL_FUTURE").
of "IO::AIO::MCL_CURRENT", "IO::AIO::MCL_FUTURE" and
"IO::AIO::MCL_ONFAULT").
On systems that do not implement "mlockall", this function returns
-1 and sets errno to "ENOSYS".
-1 and sets errno to "ENOSYS". Similarly, flag combinations not
supported by the system result in a return value of -1 with errno
being set to "EINVAL".
Note that the corresponding "munlockall" is synchronous and is
documented under "MISCELLANEOUS FUNCTIONS".
......@@ -1640,7 +1665,7 @@ FUNCTIONS
File birth time is only available when the OS and perl support it
(on FreeBSD and NetBSD at the time of this writing, although support
is adaptive, so if your OS/perl gains support, IO::AIO can take
avdantage of it). On systems where it isn't available, 0 is
advantage of it). On systems where it isn't available, 0 is
currently returned, but this might change to "undef" in a future
version.
......@@ -1666,11 +1691,11 @@ FUNCTIONS
maybe more in future versions).
$counter = IO::AIO::st_gen
Returns the generation counter of the file. This is only available
on platforms which have this member in their "struct stat" (most
BSDs at the time of this writing) and generally only to the root
usert. If unsupported, 0 is returned, but this might change to
"undef" in a future version.
Returns the generation counter (in practice this is just a random
number) of the file. This is only available on platforms which have
this member in their "struct stat" (most BSDs at the time of this
writing) and generally only to the root usert. If unsupported, 0 is
returned, but this might change to "undef" in a future version.
Example: print the high resolution modification time of /etc, using
"stat", and "IO::AIO::aio_stat".
......@@ -1853,6 +1878,10 @@ FUNCTIONS
On systems where this call is not supported or is not emulated, this
call returns falls and sets $! to "ENOSYS".
IO::AIO::mlockall $flags
Calls the "eio_mlockall_sync" function, which is like
"aio_mlockall", but is blocking.
IO::AIO::munlock $scalar, $offset = 0, $length = undef
Calls the "munlock" function, undoing the effects of a previous
"aio_mlock" call (see its description for details).
......@@ -1912,7 +1941,26 @@ FUNCTIONS
my ($rfh, $wfh) = IO::AIO::pipe2 IO::AIO::O_CLOEXEC
or die "pipe2: $!\n";
$fh = IO::AIO::eventfd [$initval, [$flags]]
$fh = IO::AIO::memfd_create $pathname[, $flags]
This is a direct interface to the Linux memfd_create(2) system call.
The (unhelpful) default for $flags is 0, but your default should be
"IO::AIO::MFD_CLOEXEC".
On success, the new memfd filehandle is returned, otherwise returns
"undef". If the memfd_create syscall is missing, fails with
"ENOSYS".
Please refer to memfd_create(2) for more info on this call.
The following $flags values are available: "IO::AIO::MFD_CLOEXEC",
"IO::AIO::MFD_ALLOW_SEALING" and "IO::AIO::MFD_HUGETLB".
Example: create a new memfd.
my $fh = IO::AIO::memfd_create "somenameforprocfd", IO::AIO::MFD_CLOEXEC
or die "m,emfd_create: $!\n";
=item $fh = IO::AIO::eventfd [$initval, [$flags]]
This is a direct interface to the Linux eventfd(2) system call. The
(unhelpful) defaults for $initval and $flags are 0 for both.
......@@ -1928,16 +1976,17 @@ FUNCTIONS
Example: create a new eventfd filehandle:
$fh = IO::AIO::eventfd 0, IO::AIO::O_CLOEXEC
$fh = IO::AIO::eventfd 0, IO::AIO::EFD_CLOEXEC
or die "eventfd: $!\n";
$fh = IO::AIO::timerfd_create $clockid[, $flags]
This is a direct interface to the Linux timerfd_create(2) system
call. The (unhelpful) default for $flags is 0.
call. The (unhelpful) default for $flags is 0, but your default
should be "IO::AIO::TFD_CLOEXEC".
On success, the new timerfd filehandle is returned, otherwise
returns "undef". If the eventfd syscall is missing, fails with
"ENOSYS".
returns "undef". If the timerfd_create syscall is missing, fails
with "ENOSYS".
Please refer to timerfd_create(2) for more info on this call.
......
......@@ -27,6 +27,9 @@
/* splice/vmsplice/tee(2) are available */
#undef HAVE_LINUX_SPLICE
/* memfd_create(2) is available */
#undef HAVE_MEMFD_CREATE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
......@@ -57,6 +60,9 @@
/* sendfile(2) is available and supported */
#undef HAVE_SENDFILE
/* statx(2) is available */
#undef HAVE_STATX
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
......@@ -108,6 +114,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
/* timerfd_*(2) are available */
#undef HAVE_TIMERFD
......
......@@ -3964,6 +3964,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <fcntl.h>
int main (void)
{
......@@ -4078,6 +4079,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <fcntl.h>
int main (void)
{
......@@ -4278,10 +4280,10 @@ else
#include <sys/time.h>
#include <sys/resource.h>
int res;
int main (void)
{
struct rlimit srl;
int res;
srl.rlim_cur = srl.rlim_max = RLIM_INFINITY;
res = getrlimit (RLIMIT_NOFILE, &srl);
res = setrlimit (RLIMIT_NOFILE, &srl);
......@@ -4413,6 +4415,20 @@ fi
done
for ac_header in sys/uio.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_uio_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_UIO_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for splice, vmsplice and tee" >&5
$as_echo_n "checking for splice, vmsplice and tee... " >&6; }
if ${ac_cv_linux_splice+:} false; then :
......@@ -4421,7 +4437,9 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <fcntl.h>
#include <sys/uio.h>
int main (void)
{
ssize_t res;
......@@ -4456,9 +4474,9 @@ else
#include <fcntl.h>
#include <unistd.h>
int res;
int main (void)
{
int res;
res = pipe2 (0, 0);
return 0;
}
......@@ -4487,9 +4505,9 @@ else
/* end confdefs.h. */
#include <sys/eventfd.h>
int res;
int main (void)
{
int res;
res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK);
return 0;
}
......@@ -4509,8 +4527,8 @@ test $ac_cv_eventfd = yes &&
$as_echo "#define HAVE_EVENTFD 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerfd" >&5
$as_echo_n "checking for timerfd... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerfd_*" >&5
$as_echo_n "checking for timerfd_*... " >&6; }
if ${ac_cv_timerfd+:} false; then :
$as_echo_n "(cached) " >&6
else
......@@ -4518,10 +4536,10 @@ else
/* end confdefs.h. */
#include <sys/timerfd.h>
int res;
int main (void)
{
struct itimerspec its;
int res;
res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK);
res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0);
res = timerfd_gettime (res, &its);
......@@ -4543,6 +4561,36 @@ test $ac_cv_timerfd = yes &&
$as_echo "#define HAVE_TIMERFD 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for memfd_create" >&5
$as_echo_n "checking for memfd_create... " >&6; }
if ${ac_cv_memfd_create+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/mman.h>
int main (void)
{
int res = memfd_create ("name", MFD_CLOEXEC | MFD_ALLOW_SEALING);
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_memfd_create=yes
else
ac_cv_memfd_create=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_memfd_create" >&5
$as_echo "$ac_cv_memfd_create" >&6; }
test $ac_cv_memfd_create = yes &&
$as_echo "#define HAVE_MEMFD_CREATE 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for copy_file_range" >&5
$as_echo_n "checking for copy_file_range... " >&6; }
if ${ac_cv_copy_file_range+:} false; then :
......@@ -4554,9 +4602,9 @@ else
#include <unistd.h>
#include <sys/syscall.h>
/*#include <linux/copy.h>*/
int res;
int main (void)
{
int res;
/*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/
res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0);
return 0;
......@@ -4738,6 +4786,47 @@ test $ac_cv_st_gen = yes &&
$as_echo "#define HAVE_ST_GEN 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statx" >&5
$as_echo_n "checking for statx... " >&6; }
if ${ac_cv_statx+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
int res;
int main (void)
{
struct statx sx;
int res;
res = statx (AT_FDCWD, ".",
AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT | AT_STATX_FORCE_SYNC | AT_STATX_DONT_SYNC,
STATX_ALL, &sx);
STATX_TYPE; STATX_MODE; STATX_NLINK; STATX_UID; STATX_GID; STATX_ATIME; STATX_MTIME; STATX_CTIME;
STATX_INO; STATX_SIZE; STATX_BLOCKS; STATX_BASIC_STATS; STATX_BTIME; STATX_ALL;
STATX_ATTR_COMPRESSED; STATX_ATTR_IMMUTABLE; STATX_ATTR_APPEND; STATX_ATTR_NODUMP; STATX_ATTR_ENCRYPTED;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_statx=yes
else
ac_cv_statx=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_statx" >&5
$as_echo "$ac_cv_statx" >&6; }
test $ac_cv_statx = yes &&
$as_echo "#define HAVE_STATX 1" >>confdefs.h
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
......
......@@ -14,10 +14,10 @@ m4_include([libeio/libeio.m4])
AC_CACHE_CHECK(for set/getrlimit, ac_cv_rlimits, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <sys/time.h>
#include <sys/resource.h>
int res;
int main (void)
{
struct rlimit srl;
int res;
srl.rlim_cur = srl.rlim_max = RLIM_INFINITY;
res = getrlimit (RLIMIT_NOFILE, &srl);
res = setrlimit (RLIMIT_NOFILE, &srl);
......@@ -67,8 +67,14 @@ AC_CHECK_HEADERS([sys/sysmacros.h])
dnl solaris major/minor
AC_CHECK_HEADERS([sys/mkdev.h])
dnl readv / preadv, vmsplice
AC_CHECK_HEADERS([sys/uio.h])
AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <sys/types.h>
#include <fcntl.h>
#include <sys/uio.h>
int main (void)
{
ssize_t res;
......@@ -83,9 +89,9 @@ test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplic
AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
#include <unistd.h>
int res;
int main (void)
{
int res;
res = pipe2 (0, 0);
return 0;
}
......@@ -94,21 +100,21 @@ test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available)
AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <sys/eventfd.h>
int res;
int main (void)
{
int res;
res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK);
return 0;
}
]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)])
test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available)
AC_CACHE_CHECK(for timerfd, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
AC_CACHE_CHECK(for timerfd_*, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <sys/timerfd.h>
int res;
int main (void)
{
struct itimerspec its;
int res;
res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK);
res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0);
res = timerfd_gettime (res, &its);
......@@ -117,13 +123,23 @@ int main (void)
]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)])
test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available)
AC_CACHE_CHECK(for memfd_create, ac_cv_memfd_create, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <sys/mman.h>
int main (void)
{
int res = memfd_create ("name", MFD_CLOEXEC | MFD_ALLOW_SEALING);
return 0;
}
]])],ac_cv_memfd_create=yes,ac_cv_memfd_create=no)])
test $ac_cv_memfd_create = yes && AC_DEFINE(HAVE_MEMFD_CREATE, 1, memfd_create(2) is available)
AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <sys/syscall.h>
/*#include <linux/copy.h>*/
int res;
int main (void)
{
int res;
/*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/
res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0);
return 0;
......@@ -197,5 +213,26 @@ int main (void)
]])],ac_cv_st_gen=yes,ac_cv_st_gen=no)])
test $ac_cv_st_gen = yes && AC_DEFINE(HAVE_ST_GEN, 1, stat st_gen member)
AC_CACHE_CHECK(for statx, ac_cv_statx, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
int res;
int main (void)
{
struct statx sx;
int res;
res = statx (AT_FDCWD, ".",
AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_STATX_SYNC_AS_STAT | AT_STATX_FORCE_SYNC | AT_STATX_DONT_SYNC,
STATX_ALL, &sx);
STATX_TYPE; STATX_MODE; STATX_NLINK; STATX_UID; STATX_GID; STATX_ATIME; STATX_MTIME; STATX_CTIME;
STATX_INO; STATX_SIZE; STATX_BLOCKS; STATX_BASIC_STATS; STATX_BTIME; STATX_ALL;
STATX_ATTR_COMPRESSED; STATX_ATTR_IMMUTABLE; STATX_ATTR_APPEND; STATX_ATTR_NODUMP; STATX_ATTR_ENCRYPTED;
return 0;
}
]])],ac_cv_statx=yes,ac_cv_statx=no)])
test $ac_cv_statx = yes && AC_DEFINE(HAVE_STATX, 1, statx(2) is available)
AC_OUTPUT