summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2011-05-12* io.c (select_internal): remove unused variable (interrupt_flag).kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* io.c (Init_IO): Added File::CLOEXEC constant. [ruby-core:22893] [Feature ↵kosaki
#1291] * test/ruby/test_io.rb (TestIO#test_o_cloexec): test for File::CLOEXEC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* io.c (rb_f_select): remove useless ifdef.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): new.kosaki
* thread.c (select_single): select(2) based backend for rb_wait_for_single_fd(). * io.c (make_writeconv): use rb_wait_for_single_fd() instaed of rb_thread_fd_select(). * io.c (rb_io_wait_readable): ditto. * thread.c (rb_thread_wait_fd_rw): ditto. * io.c (wait_readable): removed. * thread.c (init_set_fd): new helper function. * include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT): new constant for rb_single_wait_fd(). The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* include/ruby/intern.h (rb_thread_select): mark as deprecated.kosaki
* ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select instead of rb_thread_select. * ext/socket/init.c (wait_connectable0): ditto. * ext/readline/readline.c (readline_event): ditto. * io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable, wait_writable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* io.c (copy_stream_body, rb_io_s_copy_stream): move rb_fd_init()kosaki
from copy_stream_body to rb_io_s_copy_stream. fds of passing rb_fd_term() have to be guaranteed initialized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29* io.c (make_writeconv): do not add textmode newline decorator if anynobu
newline decorator is set already. fixes #4618, fixes #4619 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-27* io.c (rb_io_extract_modeenc, rb_f_backquote): set default textnobu
mode. fixes #4619 * io.c (pipe_open): set universal newline decorator if needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26* io.c (validate_enc_binmode, rb_io_extract_modeenc): set newlinenobu
decorator according to open mode. * transcode.c (rb_econv_prepare_options): new function, to prepare econv options with newline flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-14* io.c (rb_f_syscall): reduce warning: "HAVE___SYSCALL" is not defined.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-13* io.c (rb_io_fdatasync): remove unused variable.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-11* io.c: revert r31230.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-04* io.c (rb_io_syswrite): While local FS writes are usuallykosaki
buffered, the buffers can be full or the file opened with O_SYNC. IO#syswrite can also be used on blocking IOs (pipe/socket) just like IO#write. The patch is written by Eric Wong. [ruby-core:35554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-03* configure.in: disable fdatasync again on Mac OS X.kosaki
[ruby-core:35493][Bug #4500] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-03* io.c (io_reopen): IO#close releases GVL if possible.kosaki
close() may block for certain file types (NFS, SO_LINGER sockets, inotify), so let other threads run. The patch was created by Eric Wong [ruby-core:35555][Bug #4527] * io.c (fptr_finalize): ditto. * io.c (maygvl_fclose): new. * io.c (nogvl_fclose): ditto. * io.c (maygvl_close): ditto. * io.c (nogvl_close): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-05* io.c (io_cntl): use rb_thread_io_blocking_region() insteadkosaki
rb_thread_blocking_region(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-04* io.c (io_cntl, nogvl_io_cntl): IO.fcntl() and IO.ioctl()kosaki
release GVL during calling kernel interface. Suggested by Eric Wong. [ruby-core:35417][Bug #4463] * test/ruby/test_io.rb (TestIO#test_fcntl_lock): add new test for IO.fcntl(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-04* io.c (io_cntl): change 'cmd' type to int. ioctl and fcntl need tokosaki
be passed int. * io.c (rb_io_ctl): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-20* prevent temporary objects from GC, and should not usenobu
RSTRING_PTR() for function calls since it evaluates the argument a couple of times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* thread.c (rb_thread_io_blocking_region): new function to runnobu
blocking region with GIL released, for fd. * thread.c (rb_thread_fd_close): implement. [ruby-core:35203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-08* io.c (rb_io_s_sysopen): use NUM2MODET() instead NUM2UINT().kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02 * io.c (rb_io_fdatasync): Use fsync(2) if if the underlyingkosaki
operating system does not support fdatasync(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30io.c (struct argf): char behaves like an unsigned char by default on AIX.kanemoto
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=/com.ibm.xlcpp111.aix.doc/language_ref/ch.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-28 * io.c (rb_io_open): Use NUM2MODET() instead NUM2UINT().kosaki
* io.c (rb_scan_open_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-13* io.c (argf_next_argv): go advance when the next file cannot benobu
read. [ruby-core:34446] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-12 * io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-12 * io.c (rb_f_syscall): Some syscall return unsigned or pointer value.kosaki
Therefore we should only check the result is -1 or not. [ruby-core:34062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-12 * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takeskosaki
long type arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-09* io.c (Kernel.#syscall): implemented on LP64/LLP64 environments too.yugui
also uses __syscall if available for *BSD on 64bit architecture. [ruby-core:34062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08fix spaces.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-29* io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILEnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-27fix a typokazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * io.c (advice_arg_check): Change argument check.kosaki
Now, an unsupported advice makes NotImplementedError. [ruby-dev:42887] [Ruby 1.9-Feature#4204] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * io.c (pipe_open): Added rb_thread_atfork(). We must reinitializekosaki
GVL at new process creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25* io.c (rb_io_extract_encoding_option): accept Encoding object asnobu
encoding: optional argument. [ruby-dev:42884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 * io.c : add an extra byte to buffer for the specification of readtarui
in Windows. see [ruby-core:33460] and r29980. and, we have to discuss how to do this one byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-19 * io.c (Init_IO): Added O_DIRECT. This feature was propsed by Run ↵kosaki
Paint Run Run. [Feature #4015] [ruby-core:33018] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-16* io.c: removed garbage line.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-16* io.c (rb_io_advise): removed unused variable, and fix indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-16Fix indentationkosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-16 * io.c (rb_io_advise): New API. IO#advise() allows to tell thekosaki
ruby runtime how it expects to use a file handle. This feature can be improved a performance some situations. Note: This feature is mainly developed by Run Paint Run Run. Thank you! [ruby-core:33110] [Ruby 1.9-Feature#4038] * io.c (do_io_advise): Helper function. * io.c (io_advise_sym_to_const): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-16* io.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-15* io.c (nogvl_copy_stream_sendfile): fix missing condition.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-15* io.c (simple_sendfile): enable on Mac OS X.nobu
* io.c (nogvl_copy_stream_sendfile): moved precheck of copy length. * io.c (nogvl_copy_stream_sendfile): should wait for both of read/write fds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-14* io.c (simple_sendfile): improve linux compatibility on FreeBSD,naruse
and now it works. But without cpuset -l 0, it still gets stuck. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-13* io.c (simple_sendfile): disable the use of sendfile(2) onnaruse
FreeBSD. It blocks on TestIO#test_copy_stream_socket. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-13* io.c: define USE_SENDFILE on FreeBSD or DragonFly BSD.naruse
Remove Mac OS X because its argument is different from them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-13* io.c (simple_sendfile): added for BSD version of sendfile(2).naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 * io.c (io_read): duplicate string if shared. [ruby-dev:42719]tarui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-28* io.c (struct argf): make lineno long, and reorder members.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e