Date | Commit message (Collapse) |
|
Ruby 1.8 is long dead and we already broke 1.9 support by using
keyword args for splice, sendfile, and copy_file_range support.
|
|
This should hopefully simplify logic a bit and avoid expensive
access to errno.
|
|
When possible, comparisons against zero require one less load
and uses one less register, so this results in smaller code:
$ ~/linux/scripts/bloat-o-meter before.so after.so
add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-57 (-57)
function old new delta
rm_watch 84 83 -1
rb_sp_set_nonblock 80 79 -1
add_watch 127 126 -1
epwait 692 687 -5
s_new 970 921 -49
This style is favored by major C projects, including glibc.
Note: since file and file descriptor flags may eventually use
more bits of an integer, we continue comparing F_GETFD/F_GETFL
return values against -1 to be future proof.
|
|
Ruby 2.0 creates file descriptors with the close-on-exec flag
specified by default. Unless a user specifies flags explicitly,
assume the default is to set the close-on-exec.
This does not change behavior of Ruby 1.9 and earlier.
|
|
The file descriptor may be closed while GVL is released,
so we must reload the descriptor before and after calling
rb_io_wait_*able functions.
We reload before calling rb_io_wait_*able because the GVL was
released for the function call (read/write) which triggered
EAGAIN.
We reload after calling rb_io_wait_*able because
rb_io_wait_*able releases the GVL, too.
|
|
We don't want to operate on improper FDs in multithreaded
environment. This affects MRI despite the GVL since file
descriptors are usually allocated without the GVL held
(open()/accept()).
|
|
It's fewer lines of code and cleaner in cases where "new"
and "for_fd" are the same underlying method.
|
|
Yes, people still use 32-bit machines
|
|
Stupid typo :x
|
|
Instead, allow a nonblock flag to be passed to
EventFD#incr and EventFD#value so it matches other
interfaces.
|
|
|
|
Just reuse 1.9 methods
|
|
No need to repeat it and bloat ourselves.
|
|
Might as well, since it forces me to understand these
interfaces, too :)
|
|
Arguments now take symbols and arrays of symbols just like the
SignalFD.new method. This fixes some use of signed vs unsigned
integer conversions as well.
|
|
Oops :X
|
|
Switch documentation over to wrongdoc, no more JavaScript!
Our documentation still sucks.
|
|
This wraps the eventfd(2) interface of Linux. Like TimerFD, it
is not available on older distributions.
|