Eric Wong [Sat, 22 Feb 2020 01:02:38 +0000 (22 01:02 +0000)]
Ruby io_splice 4.4.2 - URL + doc updates
doc: update URLs to point to YHBT.net
bogomips.org is going away since .org isn't going to
be affordable, anymore. While we're at it, stop requiring
olddoc to just build the gem.
Eric Wong [Sat, 22 Feb 2020 01:00:34 +0000 (22 01:00 +0000)]
doc: update URLs to point to YHBT.net
bogomips.org is going away since .org isn't going to
be affordable, anymore. While we're at it, stop requiring
olddoc to just build the gem.
Eric Wong [Wed, 2 Jan 2019 20:57:59 +0000 (2 20:57 +0000)]
Ruby io_splice 4.4.1 - minor updates
This release fixes mismatched indentation warnings in
Ruby 2.6+. There are also some minor doc updates.
Of course, all the relevant functionality is also in the
"sleepy_penguin" RubyGem. So chances are you won't need
this package and increase overhead from DSOs(*)
4 changes since v4.4.0
io/splice: fix mismatched indentation warnings
pkg.mk: build system updates
doc: update URLs to HTTPS and remove refs to mail software
README: add a note on sleepy_penguin providing splice + tee
(*) https://udrepper.livejournal.com/8790.html
Eric Wong [Wed, 2 Jan 2019 19:54:00 +0000 (2 19:54 +0000)]
README: add a note on sleepy_penguin providing splice + tee
Eric Wong [Wed, 2 Jan 2019 10:36:32 +0000 (2 10:36 +0000)]
doc: update URLs to HTTPS and remove refs to mail software
No need to market or promote anything, here.
Eric Wong [Wed, 2 Jan 2019 10:26:28 +0000 (2 10:26 +0000)]
pkg.mk: build system updates
Mainly, pass --local to "'gem install"
Eric Wong [Fri, 18 May 2018 03:03:45 +0000 (18 03:03 +0000)]
io/splice: fix mismatched indentation warnings
Ruby 2.6.0dev warns about these
Eric Wong [Sun, 11 Jan 2015 08:24:28 +0000 (11 08:24 +0000)]
Ruby io_splice 4.4.0 - minor updates
Most notably the mailing list is now subscription-optional
on the bogomips.org server:
ruby-io-splice@bogomips.org
If you want to keep receiving email updates, you'll need to
resubscribe by sending a message to:
ruby-io-splice+subscribe@bogomips.org
Migrating subscribers can't be done automatically as librelist
(our old host) doesn't publish subscriber lists. But you don't
have to subscribe, either, HTTP archives are available at:
http://bogomips.org/ruby-io-splice/
There you'll also find links to ssoma/public-inbox for
extracting the mail archives to git.
shortlog:
move mailing list to ruby-io-splice@bogomips.org
switch documentation to olddoc
pack internal structs for 64-bit systems
favor comparisons against zero instead of -1
doc updates
Again, the io_splice 5.x will remove the mistake of the
IO::Splice.copy_stream method. Users are encouraged to use
IO.copy_stream in Ruby (1.9+) itself instead.
Eric Wong [Sun, 11 Jan 2015 08:28:17 +0000 (11 08:28 +0000)]
gemspec: remove dead wrongdoc stuff
Old wrongdoc cruft, update for olddoc.
Eric Wong [Sun, 11 Jan 2015 08:22:39 +0000 (11 08:22 +0000)]
doc updates
Remove LATEST from being rdoc-ed at all, and update the
(mostly useless) private email address.
Eric Wong [Sat, 10 Jan 2015 03:31:46 +0000 (10 03:31 +0000)]
favor comparisons against zero instead of -1
This should allow faster instructions to be used in some cases.
Technically this may be less pedantically correct, but there is
enough existing code out there which does the same thing to
discourage kernel/libc developers from overloading negative
return values.
...And glibc even favors comparison against zero, too.
Eric Wong [Sat, 10 Jan 2015 03:24:42 +0000 (10 03:24 +0000)]
pack internal structs for 64-bit systems
This reduces stack usage in some places, perhaps providing a
miniscule improvement in GC performance.
struct before after difference
splice_args 48 40 8
vmsplice_args 32 24 8
Eric Wong [Sat, 10 Jan 2015 03:00:24 +0000 (10 03:00 +0000)]
switch documentation to olddoc
wrongdoc was difficult to maintain because of the tidy-ffi
dependency and the HTML5 changes in Darkfish could not be
handled well by Tidy.
olddoc is superior as it generates leaner HTML which loads faster,
requires less scrolling and less processing power to render.
Aesthetic comparisons are subjective of course but completely
unimportant compared to speed and accessibility.
ref: http://80x24.org/olddoc/
Eric Wong [Sat, 10 Jan 2015 02:43:37 +0000 (10 02:43 +0000)]
move mailing list to ruby-io-splice@bogomips.org
The public-inbox + mlmmj setup on bogomips.org allows posting
without subscription and offers downloadable archives via git.
The lack of rsyncable archives on librelist nowadays and
subscription-required nature of librelist are points against it.
Repliers are now encouraged to Cc: all recipients (using the
reply-all function of their mail client) since many readers are
not subscribed.
This project has never accepted or encouraged HTML email, but
librelist accepted it. The bogomips.org mail server is
configured to treat HTML mail as spam, so do not send HTML mail
if you expect a response.
Users who wish to subscribe may send a message to:
ruby-io-splice+subscribe@bogomips.org
Similarly, they may unsubscribe via:
ruby-io-splice+unsubscribe@bogomips.org
HTTP archives are available via:
http://bogomips.org/ruby-io-splice/
ssoma users may also use: git://bogomips.org/ruby-io-splice
(see README change)
Old messages to the librelist addresses will continue to
get routed to the new mailing list.
ref: http://public-inbox.org/
Eric Wong [Sat, 15 Feb 2014 10:17:52 +0000 (15 10:17 +0000)]
io_splice 4.3.0 - cleanups and compatibility fixes
This release fixes compatibility with Ruby trunk r44955 and onwards.
There are also numerous cleanups.
Note: usage of IO::Splice::WAITALL is deprecated and will be removed
in 5.x along with IO::Splice.copy_stream.
Eric Wong [Sat, 15 Feb 2014 09:53:47 +0000 (15 09:53 +0000)]
avoid deprecated rb_thread_blocking_region on 2.0+
rb_thread_blocking_region is not in ruby trunk as of r44955
Eric Wong [Sun, 9 Feb 2014 07:42:15 +0000 (9 07:42 +0000)]
deprecate and remove docs for IO::Splice::WAITALL
This functionality should not be implemented in Ruby, at least.
This flag could also conflict with future flags used by the
underlying syscalls.
Eric Wong [Sun, 9 Feb 2014 07:26:52 +0000 (9 07:26 +0000)]
remove copy_stream tests and references
It is deprecated, so stop testing and advertising it.
Eric Wong [Sun, 9 Feb 2014 00:50:03 +0000 (9 00:50 +0000)]
prepare for rb_thread_blocking_region removal
It'll be OK to use rb_thread_call_without_gvl when
rb_thread_blocking_region is not detectable at all.
We still use rb_thread_blocking_region for Ruby 2.0-2.1 because
rb_thread_call_without_gvl was detectable in 1.9.3, but not
usable as an internal symbol.
ref: https://bugs.ruby-lang.org/issues/9502
Eric Wong [Mon, 30 Sep 2013 18:22:15 +0000 (30 18:22 +0000)]
Rakefile: kill raa_update task
RAA is dead
Eric Wong [Thu, 26 Sep 2013 18:54:33 +0000 (26 18:54 +0000)]
avoid RARRAY_PTR usage for vmsplice
In case somebody finds vmsplice useful in Ruby, we avoid incurring
the performance loss from RARRAY_PTR under Ruby 2.1.0 and Rubinius.
However, I still haven't found a useful use of vmsplice under
Ruby (or any high-level languages).
Eric Wong [Sun, 12 May 2013 20:01:00 +0000 (12 20:01 +0000)]
.gitignore: add .rbx
Newer versions of Rubinius generate files in .rbx.
Eric Wong [Sun, 12 May 2013 19:59:45 +0000 (12 19:59 +0000)]
io/splice: deprecated potentially unsafe methods
In retrospect, these methods are too infrequently useful and
causes problems too easily to be worth supporting.
Eric Wong [Sun, 21 Apr 2013 03:22:26 +0000 (21 03:22 +0000)]
set close-on-exec in pipe size modification check
This prevents a file descriptor leak in case another thread
forks and execs while we are in the middle of loading. This
places a hard dependency on pipe2, but pipe2 appeared in Linux
before pipe size modification.
Eric Wong [Sat, 19 Jan 2013 08:12:06 +0000 (19 08:12 +0000)]
io_splice 4.2.0 - several bugfixes and workarounds
We now limit maximum splice length to (1<<30) to avoid EINVAL
errors on 64-bit hosts.
vmsplice no longer raises Errno::EFAULT optimizations in newer
GCC (not that I've found a good use for vmsplice at all with
Ruby...)
There are several other small cleanups.
Eric Wong (6):
copy_stream: small cleanup for pipe splicing
limit maximum splice length to 1 << 30
avoid uname() for pipe size modification checks
doc: s/librelist.com/librelist.org/
vmsplice: avoid referencing invalid stack address for strings
vmsplice: more consistent fileno retry handling
Eric Wong [Sat, 19 Jan 2013 08:10:23 +0000 (19 08:10 +0000)]
vmsplice: more consistent fileno retry handling
While vmsplice is hardly useful, its FD-closed-while-GVL-less
handling should be as good as our splice and tee wrappers.
Eric Wong [Sat, 19 Jan 2013 03:08:06 +0000 (19 03:08 +0000)]
vmsplice: avoid referencing invalid stack address for strings
Newer GCC more aggressively optimizes stack allocations away,
so we need to avoid passing out-of-scope addresses to vmsplice.
Not that vmsplice is useful in Ruby...
Eric Wong [Thu, 8 Mar 2012 05:20:15 +0000 (8 05:20 +0000)]
doc: s/librelist.com/librelist.org/
.org makes us look less commercial, which may be
important to some folks. Yes, this project is
run by a dirty hippie.
Eric Wong [Wed, 7 Mar 2012 10:27:46 +0000 (7 10:27 +0000)]
avoid uname() for pipe size modification checks
The uname comparison is fragile and we can better
detect this during the Init_* function by just using
a pipe.
Eric Wong [Wed, 18 May 2011 22:36:52 +0000 (18 15:36 -0700)]
limit maximum splice length to 1 << 30
This is the same value haproxy has to work around the same
issue on 64-bit platforms.
ref:
a9de333aa58e6cb76f08a50e8ba2c5931184068f in
http://git.1wt.eu/git/haproxy.git
Eric Wong [Wed, 18 May 2011 20:47:54 +0000 (18 13:47 -0700)]
copy_stream: small cleanup for pipe splicing
No need to loop on IO::Splice.full, it already loops
internally whenever it makes sense.
Eric Wong [Wed, 18 May 2011 00:15:49 +0000 (17 17:15 -0700)]
io_splice 4.1.1 - workaround socket -> pipe issues
IO::Splice.copy_stream now uses SPLICE_F_NONBLOCK whenever the
destination is a pipe. Our documentation is also updated to
reflect the issue of splicing from sockets into pipes.
ref: http://lkml.org/lkml/2009/1/13/478
Eric Wong [Wed, 18 May 2011 00:12:48 +0000 (17 17:12 -0700)]
expand doc for non-blocking splice into a pipe
We should warn our users to avoid a blocking splice() from a
socket into a pipe if the socket buffers are full unless there's
a blocking read/splice on the other end of the pipe.
Eric Wong [Tue, 17 May 2011 03:18:12 +0000 (16 20:18 -0700)]
copy_stream: always use SPLICE_F_NONBLOCK for partial copy
The pipe may be full from small buffers due to how TCP
works, so we need to use non-blocking I/O on the pipe.
ref: http://lkml.org/lkml/2009/1/13/478
Eric Wong [Mon, 16 May 2011 16:28:48 +0000 (16 09:28 -0700)]
io_splice 4.1.0 - copy_stream enhancement for 1.9
IO::Splice.copy_stream coerces based on the availability of
the #to_path method in source and destination arguments.
This is to be compatible with IO.copy_stream and also
Rack::File since this may be used in web servers.
This is NOT visible with Ruby 1.8 since File.open
doesn't coerce with #to_path on the given object.
Eric Wong [Fri, 13 May 2011 19:59:13 +0000 (13 12:59 -0700)]
copy_stream coerces based on #to_path
This is to be compatible with IO.copy_stream and also
Rack::File since this may be used in web servers.
This is NOT compatible with Ruby 1.8 since File.open
doesn't coerce with #to_path on the given object.
Eric Wong [Fri, 13 May 2011 02:39:12 +0000 (12 19:39 -0700)]
io_splice 4.0.0 - easier to use!
Methods now automatically retry on EINTR after checking
IO#closed? and executing interrupts.
There is a new IO::Splice::WAITALL flag (implemented in
userspace) which may be used to cause IO.splice and IO.tee
to retry (while the GVL is released) until the operation
is complete.
IO::Splice.copy_stream now works correctly for large copies
if source offset is specified.
MRI 1.8 is only weakly supported now, MRI 1.9 is the
preferred platform though Rubinius appears to work, too.
Eric Wong [Fri, 13 May 2011 02:28:41 +0000 (12 19:28 -0700)]
fix up documentation for fd vs IO objects
We support both, but IO objects are easier to use so
refer to those in the documentation.
Eric Wong [Fri, 13 May 2011 02:13:57 +0000 (12 19:13 -0700)]
copy_stream: enough to get this working under MRI 1.8
This way at least 1.8 users can have something akin to
IO.copy_stream.
Eric Wong [Fri, 13 May 2011 01:59:44 +0000 (12 18:59 -0700)]
test_copy_stream: fix userspace buffering assumption
And enable UNIX socket tests for this
Eric Wong [Fri, 13 May 2011 00:25:08 +0000 (12 17:25 -0700)]
add copy_stream test from MRI
This helps flesh out some inconsistencies between our
implementation and IO.copy_stream in MRI. Some things
we won't care about though, like userspace buffering.
Eric Wong [Fri, 13 May 2011 00:22:57 +0000 (12 17:22 -0700)]
copy_stream: update src_offset on retries
Oops :x
Eric Wong [Tue, 10 May 2011 19:42:38 +0000 (10 12:42 -0700)]
copy_stream attempts to use IO::Splice::WAITALL
This reduces Ruby method dispatches
Eric Wong [Tue, 10 May 2011 19:36:59 +0000 (10 12:36 -0700)]
test_io_splice: disable timeout-related tests in non-MRI
timeout doesn't seem to interrupt C extensions reliably
in some cases...
Eric Wong [Tue, 10 May 2011 00:57:10 +0000 (9 17:57 -0700)]
add IO::Splice::WAITALL flag support
This allows splice-in-full and tee-in-full behavior
to simplify user code.
Eric Wong [Mon, 9 May 2011 20:54:54 +0000 (9 13:54 -0700)]
test_io_splice_eintr: beef up test
Also works under Rubinius
Eric Wong [Mon, 9 May 2011 20:45:28 +0000 (9 13:45 -0700)]
use ssize_t/size_t instead of long/unsigned long
Easier to read this way since it matches upstream
functions.
Eric Wong [Mon, 9 May 2011 20:43:39 +0000 (9 13:43 -0700)]
EINTR test only works under 1.9
Not that we feel like supporting 1.8 any longer..
Eric Wong [Mon, 9 May 2011 20:28:19 +0000 (9 13:28 -0700)]
detect closed descriptors on EINTR
We don't want to retry with the same FD if it somehow
got closed and reopened in a different thread. We
could possibly have Errno::EBADF, too, but
rb_thread_io_blocking_region doesn't allow multiple
file descriptors...
Eric Wong [Mon, 9 May 2011 20:18:42 +0000 (9 13:18 -0700)]
my_fileno: use FIX2INT instead of NUM2INT
No chance in hell a file descriptor can be a Bignum...
Eric Wong [Mon, 9 May 2011 20:12:25 +0000 (9 13:12 -0700)]
retry on EINTR
This makes things consistent with Ruby core IO methods
Eric Wong [Sun, 1 May 2011 21:11:11 +0000 (1 14:11 -0700)]
io_splice 3.1.0 - IO::Splice.copy_stream improvement
IO::Splice.copy_stream no longer modifies the actual file offset
of the given source file (if it's a regular file). This follows
IO.copy_stream and IO#sendfile semantics, allowing multiple
threads/processes to simultaneously stream a single regular file
descriptor to multiple sockets/pipes.
Eric Wong [Sun, 1 May 2011 20:58:23 +0000 (1 13:58 -0700)]
minor documentation updates
IO::Splice.copy_stream is more useful, now
Eric Wong [Sun, 1 May 2011 20:29:51 +0000 (1 13:29 -0700)]
IO::Splice.copy_stream doesn't change offset of source file
This is for compatibility with IO.copy_stream and IO#sendfile,
both of which use pread()-semantics when given a source file
offset. This allows multiple threads/processes to copy from
the same file handle.
Eric Wong [Wed, 27 Apr 2011 18:36:33 +0000 (27 11:36 -0700)]
extconf: remove unnecessary dir_config statement
I didn't know mkmf at the time :<
Eric Wong [Tue, 1 Mar 2011 09:29:57 +0000 (1 09:29 +0000)]
io_splice 3.0.0 - kinder, gentler Linux zero-copy
This release adds the IO.trysplice and IO.trytee interfaces
to avoid expensive EAGAIN exceptions for non-blocking I/O.
There is no IO.tryvmsplice method as we still haven't figured
out a good use for IO.vmsplice in Ruby, and non-blocking I/O
with iovecs is just painful! If you want more zero-copy fun
without needing mmap(2), check out the "sendfile" RubyGem and
IO.copy_stream (1.9). As of Linux 2.6.33+, sendfile(2) can copy
mmap-able files to +any+ descriptor, not just sockets.
Please email us at ruby.io.splice@librelist.com if you can think
of a good use for IO.vmsplice or IO.trysplice in Ruby.
Eric Wong [Mon, 28 Feb 2011 01:24:01 +0000 (28 01:24 +0000)]
doc: more notes for IO.vmsplice
HALP!
Eric Wong [Mon, 28 Feb 2011 01:08:44 +0000 (28 01:08 +0000)]
remove VERSION constant
Needless cruft and maintenance overhead.
Eric Wong [Mon, 28 Feb 2011 01:05:15 +0000 (28 01:05 +0000)]
doc: RDoc for new interfaces and changes
And yes, encourage them for non-blocking I/O users.
Eric Wong [Mon, 28 Feb 2011 00:21:28 +0000 (28 00:21 +0000)]
IO.vmsplice flags argument defaults to zero
For consistency with all of our other methods.
Eric Wong [Sun, 27 Feb 2011 23:40:44 +0000 (27 23:40 +0000)]
add IO.trytee interface
This allows more-efficient use of non-blocking I/O with
tee(2) and will return :EAGAIN instead of generating an
expensive Errno::EAGAIN exception.
Eric Wong [Sun, 27 Feb 2011 00:47:40 +0000 (26 16:47 -0800)]
trysplice implies SPLICE_F_NONBLOCK for flags
It makes more sense this way if non-blocking I/O is expected.
Eric Wong [Sun, 27 Feb 2011 00:44:17 +0000 (26 16:44 -0800)]
flags are optional for splice and trysplice
No point in requiring the flags argument if it's going to be
zero, so default them to zero if they're unset.
Eric Wong [Sun, 27 Feb 2011 00:35:56 +0000 (26 16:35 -0800)]
shorten calls to rb_thread_blocking_region
Long lines bother me
Eric Wong [Sat, 26 Feb 2011 22:45:04 +0000 (26 14:45 -0800)]
avoid signed vs unsigned comparison
Caught when compiling with the CFLAGS of Ruby 1.9.3dev
Eric Wong [Sat, 26 Feb 2011 22:43:08 +0000 (26 14:43 -0800)]
copy_stream: File.open encoding doesn't matter
No need to open in binary mode since no file data
goes through luserspace!
Eric Wong [Sat, 26 Feb 2011 22:41:19 +0000 (26 14:41 -0800)]
test: fix broken assertions on Ruby 1.9.3dev
Oops :x
Eric Wong [Sat, 26 Feb 2011 22:40:48 +0000 (26 14:40 -0800)]
copy_stream uses IO.trysplice instead of IO.splice
Things should be slightly faster this way.
Eric Wong [Sat, 26 Feb 2011 22:20:37 +0000 (26 14:20 -0800)]
test: remove unused_port function
It's wholly unnecessary when we don't do exec() for other
processes.
Eric Wong [Sat, 26 Feb 2011 22:17:25 +0000 (26 14:17 -0800)]
add IO.trysplice interface
This reduces the cost of EAGAIN and EOF since they
are not considered exceptional conditions.
Eric Wong [Wed, 22 Dec 2010 18:57:58 +0000 (22 10:57 -0800)]
io/splice: unindent
This seems to fix the issue we had with older RDoc, too
Eric Wong [Sat, 5 Feb 2011 11:27:54 +0000 (5 03:27 -0800)]
test: cleanup unused_port function
Duh!
Eric Wong [Sat, 5 Feb 2011 11:25:47 +0000 (5 03:25 -0800)]
clean up packaging and use pkg.mk
Eric Wong [Mon, 27 Dec 2010 16:55:28 +0000 (27 16:55 +0000)]
doc: switch to wrongdoc
No more JavaScript!
Eric Wong [Mon, 27 Dec 2010 16:19:30 +0000 (27 16:19 +0000)]
GNUmakefile: sync examples for documentation publishing
The examples on our site were out-of-date.
Eric Wong [Mon, 2 Aug 2010 08:14:08 +0000 (2 08:14 +0000)]
GNUmakefile: update RAA on new releases
Eric Wong [Mon, 2 Aug 2010 07:55:57 +0000 (2 07:55 +0000)]
Ruby io_splice 2.2.0 - updates for Linux 2.6.35
This release adds IO#pipe_size and IO#pipe_size= accessors for
resizing the kernel pipe buffer under Linux 2.6.35+. This
functionality may be used to either reduce memory footprint or
make large copies with fewer method dispatches and system calls.
These methods are only available when run under Linux 2.6.35 or
later (but always built, so there's no need to recompile this
library after upgrading your kernel).
http://bogomips.org/ruby_io_splice/doc/IO.html#method-i-pipe_size
http://bogomips.org/ruby_io_splice/doc/IO.html#method-i-pipe_size%3D
Eric Wong [Mon, 2 Aug 2010 07:40:48 +0000 (2 07:40 +0000)]
add IO#pipe_size and IO#pipe_size= accessors
These are friendly wrappers around F_GETPIPE_SZ
and F_SETPIPE_SZ fcntl()s in Linux 2.6.35.
Eric Wong [Thu, 24 Jun 2010 18:46:14 +0000 (24 18:46 +0000)]
test_io_splice: fix broken test
Apparently timing variations were allowing it to succeed under
Ruby 1.8/1.9, but Rubinius tripped and exposed the bug.
Eric Wong [Sun, 6 Jun 2010 20:27:36 +0000 (6 20:27 +0000)]
Ruby io_splice 2.1.0 - IO::Splice.copy_stream fixes
This fixes the issue with our copy_stream where non-pipe
descriptors with the O_NONBLOCK flag set were not handled
correctly. Like IO.copy_stream in Ruby 1.9, our
IO::Splice.copy_stream will _always_ block until IO is available
(or raise if there are errors).
IO::Splice.copy_stream now closes all file descriptors that were
opened within the method, reducing pressure on the garbage
collector.
There are also new singleton convenience methods:
* IO::Splice.full - blocks and splices the full amount
* IO::Splice.partial - blocks until something is spliceable
They are used internally to implement IO::Splice.copy_stream,
but may also be useful to end users.
Rcov shows 100% test coverage \o/
Eric Wong [Sun, 6 Jun 2010 20:26:37 +0000 (6 20:26 +0000)]
doc: help RDoc read IO::Splice singleton methods
Eric Wong [Sun, 6 Jun 2010 19:49:12 +0000 (6 19:49 +0000)]
document +src+ and +dst+ for IO::Splice.{full,partial}
Unlike IO::Splice.copy_stream, these require at least
one of the source or destination parameters to be a
pipe.
Eric Wong [Sun, 6 Jun 2010 19:46:05 +0000 (6 19:46 +0000)]
GNUmakefile: add rcov target
Eric Wong [Sun, 6 Jun 2010 19:21:42 +0000 (6 19:21 +0000)]
copy_stream: handle and block on EAGAIN from the non-pipe IO
splice(2) (called without SPLICE_F_NONBLOCK) only blocks on the
pipe descriptor, but may trigger EAGAIN from the non-pipe
descriptor. So use IO.select to deal with the case where the
non-pipe descriptor is non-blocking and wait on it.
While we're at it, add the IO::Splice.partial and
IO::Splice.full singleton methods to make our life easier
to implement copy_stream with. These methods may also
be used directly by users who may find them useful.
Eric Wong [Sun, 6 Jun 2010 19:21:17 +0000 (6 19:21 +0000)]
GNUmakefile: allow passing options to test/unit
Eric Wong [Sun, 6 Jun 2010 17:59:10 +0000 (6 17:59 +0000)]
copy_stream: cleanup after ourselves
It's a good idea to clean up any file descriptors
opened within our method to avoid unnecessary GC
invocations.
Eric Wong [Sun, 6 Jun 2010 06:50:10 +0000 (6 06:50 +0000)]
COPYING: bundle the LGPLv2.1 instead of LGPLv3
The choice of version is up to the user, but bundle the one
more likely to be invoked.
Eric Wong [Sat, 5 Jun 2010 08:36:16 +0000 (5 08:36 +0000)]
Ruby io_splice 2.0.0
There is a new IO::Splice.copy_stream method which is similar to
the IO.copy_stream method in 1.9 core, but uses splice()
internally to avoid copies to userspace in situations where
sendfile() is not possible.
With Linux 2.6.35 (and header files to match), we will also
export the F_GETPIPE_SZ and and F_SETPIPE_SZ constants so
they can be used with fcntl() to resize pipe buffers.
The documentation is also updated to reflect the returned
usefulness of the IO::Splice::F_MOVE constant for FUSE
filesystems under Linux 2.6.35.
I've also relicensed to LGPLv2.1+ (from LGPLv3-only) to allow
bundling with GPLv2-only applications (I'm currently the sole
copyright holder).
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Sat, 5 Jun 2010 08:34:17 +0000 (5 08:34 +0000)]
update PIPE_CAPA documentation for Linux 2.6.35
Eric Wong [Sat, 5 Jun 2010 08:22:19 +0000 (5 08:22 +0000)]
relicense to LGPLv2.1+ (from LGPLv3 only)
This allows GPLv2-only programs to bundle us.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong [Sat, 5 Jun 2010 06:27:24 +0000 (5 06:27 +0000)]
GNUmakefile: make our unit tests PHONY
Eric Wong [Sat, 5 Jun 2010 06:19:17 +0000 (5 06:19 +0000)]
examples/splice-cp: simplify with IO::Splice.copy_stream
Eric Wong [Sat, 5 Jun 2010 06:02:30 +0000 (5 06:02 +0000)]
io_splice_ext: require errno.h
It seems needed for Rubinius
Eric Wong [Sat, 5 Jun 2010 05:42:54 +0000 (5 05:42 +0000)]
copy_stream takes source offset like the non-splice version
This should make it a drop-in replacement for IO.copy_stream,
except it won't deal with things like StringIO.
Eric Wong [Thu, 3 Jun 2010 07:00:43 +0000 (3 07:00 +0000)]
allow IO.vmsplice to take a single string
This could be useful if a Ruby implementation eventually gives
us page-aligned strings that we can IO::Splice::F_GIFT
Eric Wong [Tue, 1 Jun 2010 23:59:57 +0000 (1 16:59 -0700)]
copy_stream: always try to move pages instead of copying
For most case in the forseeable future it's a no-op, but
since FUSE will support it in 2.6.35, some folks will be
able to use it again.
Eric Wong [Tue, 1 Jun 2010 23:54:24 +0000 (1 16:54 -0700)]
preliminary support for F_GETPIPE_SZ and F_SETPIPE_SZ
One day soon (2.6.35), we'll be able to resize pipes. We may
support this independently of the C library since that can take
a few months/years to catch up, taking distro release cycles
into account, too.
Eric Wong [Tue, 1 Jun 2010 23:46:18 +0000 (1 16:46 -0700)]
update IO::Splice::F_MOVE documentation for 2.6.35
FUSE devices will finally gain splice() support and also
support SPLICE_F_MOVE in 2.6.35. SPLICE_F_MOVE is still
ignored for non-FUSE devices.
Eric Wong [Tue, 1 Jun 2010 23:08:46 +0000 (1 16:08 -0700)]
simplify examples for 1.0.0 API
Eric Wong [Tue, 1 Jun 2010 23:01:58 +0000 (1 16:01 -0700)]
implement IO::Splice.copy_stream
This is like IO.copy_stream in Ruby 1.9, but uses
the splice() system call internally.