Commit 9a068410 authored by gregor herrmann's avatar gregor herrmann

Imported Upstream version 4.32

parent fffa42fe
......@@ -169,7 +169,7 @@ use common::sense;
use base 'Exporter';
BEGIN {
our $VERSION = 4.31;
our $VERSION = 4.32;
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
......@@ -229,7 +229,7 @@ documentation.
aio_link $srcpath, $dstpath, $callback->($status)
aio_symlink $srcpath, $dstpath, $callback->($status)
aio_readlink $pathname, $callback->($link)
aio_realpath $pathname, $callback->($link)
aio_realpath $pathname, $callback->($path)
aio_rename $srcpath, $dstpath, $callback->($status)
aio_mkdir $pathname, $mode, $callback->($status)
aio_rmdir $pathname, $callback->($status)
......@@ -724,8 +724,8 @@ Works like truncate(2) or ftruncate(2).
=item aio_allocate $fh, $mode, $offset, $len, $callback->($status)
Allocates or freed disk space according to the C<$mode> argument. See the
linux C<fallocate> docuemntation for details.
Allocates or frees disk space according to the C<$mode> argument. See the
linux C<fallocate> documentation for details.
C<$mode> can currently be C<0> or C<IO::AIO::FALLOC_FL_KEEP_SIZE>
to allocate space, or C<IO::AIO::FALLOC_FL_PUNCH_HOLE |
......@@ -1502,9 +1502,9 @@ inside, you would write:
};
};
That C<aio_wd> is a request and not a normal function shows that creating
an IO::AIO::WD object is itself a potentially blocking operation, which is
why it is done asynchronously.
The fact that C<aio_wd> is a request and not a normal function shows that
creating an IO::AIO::WD object is itself a potentially blocking operation,
which is why it is done asynchronously.
To stat the directory obtained with C<aio_wd> above, one could write
either of the following three request calls:
......@@ -1933,7 +1933,7 @@ This is a very bad function to use in interactive programs because it
blocks, and a bad way to reduce concurrency because it is inexact: Better
use an C<aio_group> together with a feed callback.
It's main use is in scripts without an event loop - when you want to stat
Its main use is in scripts without an event loop - when you want to stat
a lot of files, you can write somehting like this:
IO::AIO::max_outstanding 32;
......@@ -1983,8 +1983,10 @@ but not yet processed by poll_cb).
=head3 MISCELLANEOUS FUNCTIONS
IO::AIO implements some functions that might be useful, but are not
asynchronous.
IO::AIO implements some functions that are useful when you want to use
some "Advanced I/O" function not available to in Perl, without going the
"Asynchronous I/O" route. Many of these have an asynchronous C<aio_*>
counterpart.
=over 4
......@@ -2112,7 +2114,7 @@ See the C<splice(2)> manpage for details.
=item IO::AIO::tee $r_fh, $w_fh, $length, $flags
Calls the GNU/Linux C<tee(2)> syscall, see it's manpage and the
Calls the GNU/Linux C<tee(2)> syscall, see its manpage and the
description for C<IO::AIO::splice> above for details.
=item $actual_size = IO::AIO::pipesize $r_fh[, $new_size]
......
......@@ -310,7 +310,7 @@ req_sv (aio_req req, HV *stash)
static SV *
newSVaio_wd (aio_wd wd)
{
return sv_bless (newRV_noinc (newSViv ((IV)wd)), aio_wd_stash);
return sv_bless (newRV_noinc (newSViv ((intptr_t)wd)), aio_wd_stash);
}
static aio_req
......@@ -1743,7 +1743,7 @@ sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count)
RETVAL
void
mmap (SV *scalar, size_t length, int prot, int flags, SV *fh = &PL_sv_undef, off_t offset = 0)
mmap (SV *scalar, STRLEN length, int prot, int flags, SV *fh = &PL_sv_undef, off_t offset = 0)
PPCODE:
sv_unmagic (scalar, MMAP_MAGIC);
{
......@@ -1780,14 +1780,14 @@ munmap (SV *scalar)
sv_unmagic (scalar, MMAP_MAGIC);
int
madvise (SV *scalar, off_t offset = 0, SV *length = &PL_sv_undef, IV advice_or_prot)
madvise (SV *scalar, STRLEN offset = 0, SV *length = &PL_sv_undef, IV advice_or_prot)
ALIAS:
mprotect = 1
CODE:
{
STRLEN svlen;
void *addr = SvPVbyte (scalar, svlen);
size_t len = SvUV (length);
STRLEN len = SvUV (length);
if (offset < 0)
offset += svlen;
......@@ -1811,7 +1811,7 @@ madvise (SV *scalar, off_t offset = 0, SV *length = &PL_sv_undef, IV advice_or_p
RETVAL
int
munlock (SV *scalar, off_t offset = 0, SV *length = &PL_sv_undef)
munlock (SV *scalar, STRLEN offset = 0, SV *length = &PL_sv_undef)
CODE:
{
STRLEN svlen;
......
......@@ -12,6 +12,7 @@ TODO: emulation for splice?
TODO: eio_mmap|mlock|munmap|splice...
TODO: syncfs/sync windows:
TODO: F_SETPIPE_SZ, F_GETPIPE_SZ
TODO: posix_fallocate when flags=0
http://stackoverflow.com/questions/65170/how-to-get-name-associated-with-open-handle/5286888#5286888
http://blogs.msdn.com/b/adioltean/archive/2005/04/16/408947.aspx
http://msdn.microsoft.com/en-us/library/aa366789%28v=vs.85%29.aspx
......@@ -21,6 +22,23 @@ 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: getrandom, GRND_NONBLOCK, GRND_NONBLOCK
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: O_TMPFILE
TODO: FALLOC_FL_COLLAPSE_RANGE
TODO: FALLOC_FL_ZERO_RANGE
TODO: renameat RENAME_EXCHANGE, RENAME_NOREPLACE, RENAME_EXCHANGE
TODO: fcntl F_GETLKP/F_SETLKP/F_SETLKPW, http://lwn.net/Articles/586904/
TODO: flink + AT_EMPTY_PATH
TODO: name_to_handle_At + open_by_handle_at = clone fds
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?
4.32 Wed Feb 11 20:32:11 CET 2015
- replace off_t by STRLEN where appropriate, should not result in
user-visible changes.
- update ecb.h for C11 compatibility.
4.31 Tue Jun 3 03:29:27 CEST 2014
- work around more 5.20 bugs. backwards compatibility my ass.
......
......@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.140640",
"generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060",
"license" : [
"unknown"
],
......@@ -37,5 +37,5 @@
}
},
"release_status" : "stable",
"version" : 4.31
"version" : 4.32
}
......@@ -7,7 +7,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.140640'
generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -19,4 +19,4 @@ no_index:
- inc
requires:
common::sense: '0'
version: 4.31
version: 4.32
......@@ -173,7 +173,7 @@ FUNCTIONS
aio_link $srcpath, $dstpath, $callback->($status)
aio_symlink $srcpath, $dstpath, $callback->($status)
aio_readlink $pathname, $callback->($link)
aio_realpath $pathname, $callback->($link)
aio_realpath $pathname, $callback->($path)
aio_rename $srcpath, $dstpath, $callback->($status)
aio_mkdir $pathname, $mode, $callback->($status)
aio_rmdir $pathname, $callback->($status)
......@@ -645,8 +645,8 @@ FUNCTIONS
Works like truncate(2) or ftruncate(2).
aio_allocate $fh, $mode, $offset, $len, $callback->($status)
Allocates or freed disk space according to the $mode argument. See
the linux "fallocate" docuemntation for details.
Allocates or frees disk space according to the $mode argument. See
the linux "fallocate" documentation for details.
$mode can currently be 0 or "IO::AIO::FALLOC_FL_KEEP_SIZE" to
allocate space, or "IO::AIO::FALLOC_FL_PUNCH_HOLE |
......@@ -1130,9 +1130,9 @@ FUNCTIONS
};
};
That "aio_wd" is a request and not a normal function shows that creating
an IO::AIO::WD object is itself a potentially blocking operation, which
is why it is done asynchronously.
The fact that "aio_wd" is a request and not a normal function shows that
creating an IO::AIO::WD object is itself a potentially blocking
operation, which is why it is done asynchronously.
To stat the directory obtained with "aio_wd" above, one could write
either of the following three request calls:
......@@ -1520,7 +1520,7 @@ FUNCTIONS
it blocks, and a bad way to reduce concurrency because it is
inexact: Better use an "aio_group" together with a feed callback.
It's main use is in scripts without an event loop - when you want to
Its main use is in scripts without an event loop - when you want to
stat a lot of files, you can write somehting like this:
IO::AIO::max_outstanding 32;
......@@ -1561,8 +1561,10 @@ FUNCTIONS
(executed, but not yet processed by poll_cb).
MISCELLANEOUS FUNCTIONS
IO::AIO implements some functions that might be useful, but are not
asynchronous.
IO::AIO implements some functions that are useful when you want to use
some "Advanced I/O" function not available to in Perl, without going the
"Asynchronous I/O" route. Many of these have an asynchronous "aio_*"
counterpart.
IO::AIO::sendfile $ofh, $ifh, $offset, $count
Calls the "eio_sendfile_sync" function, which is like
......@@ -1680,7 +1682,7 @@ FUNCTIONS
See the splice(2) manpage for details.
IO::AIO::tee $r_fh, $w_fh, $length, $flags
Calls the GNU/Linux tee(2) syscall, see it's manpage and the
Calls the GNU/Linux tee(2) syscall, see its manpage and the
description for "IO::AIO::splice" above for details.
$actual_size = IO::AIO::pipesize $r_fh[, $new_size]
......
This diff is collapsed.
......@@ -261,17 +261,16 @@ struct eio_req
long int3; /* chown, fchown: gid; rename, link: working directory of new name */
int errorno; /* errno value on syscall return */
signed char type;/* EIO_xxx constant ETP */
unsigned char flags; /* private */
signed char type;/* EIO_xxx constant ETP */
signed char pri; /* the priority ETP */
#if __i386 || __amd64
unsigned char cancelled; /* ETP */
#else
sig_atomic_t cancelled; /* ETP */
#endif
unsigned char flags; /* private */
signed char pri; /* the priority */
void *data;
eio_cb finish;
void (*destroy)(eio_req *req); /* called when request no longer needed */
......
......@@ -221,11 +221,11 @@ reqq_shift (etp_reqq *q)
for (pri = ETP_NUM_PRI; pri--; )
{
eio_req *req = q->qs[pri];
ETP_REQ *req = q->qs[pri];
if (req)
{
if (!(q->qs[pri] = (eio_req *)req->next))
if (!(q->qs[pri] = (ETP_REQ *)req->next))
q->qe[pri] = 0;
return req;
......@@ -304,7 +304,7 @@ etp_maybe_start_thread (void)
static void ecb_cold
etp_end_thread (void)
{
eio_req *req = calloc (1, sizeof (eio_req)); /* will be freed by worker */
ETP_REQ *req = calloc (1, sizeof (ETP_REQ)); /* will be freed by worker */
req->type = ETP_TYPE_QUIT;
req->pri = ETP_PRI_MAX - ETP_PRI_MIN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment