summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2011-12-07* io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]drbrain
* ext/io/console/console.c: Mention that io/console must be required similar to lib/time.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* bignum.c (big_rshift), compile.c (validate_label,nobu
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open) (rb_io_advise), parse.y (parser_compile_string) (rb_parser_compile_file), proc.c (binding_free), process.c (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core) (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null), signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main), vm_insnhelper.c (vm_expandarray): suppress unused-but-set-variable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04* io.c: suppress unused-value warnings. fixup of r33937.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04Introduce NEED_READCONV and NEED_WRITECONV to replace universal newline ↵luislavena
decorator Use CRLF only when required to improve file reading and writing under Windows. Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-01* io.c (linux_get_maxfd): change local variable name.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-29* io.c (rb_write_error2): suppress unused variable warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28* io.c (rb_write_error2): fwrite() returns ssize_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28* io.c (rb_io_flush): release GVL during fsync() on Windows.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-27* io.c (rb_write_error2): get rid of warning on linux. fwritekosaki
of glibc is tagged __attribute__ ((__warn_unused_result__)) if _FORTIFY_SOURCE != 0. * vm_dump.c (rb_vm_bugreport): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-26* io.c (copy_stream_body): use 0666 for permission argument for open.akr
[ruby-core:40865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-25* io.c (ioctl_narg_len, linux_iocparm_len): reinstantiate linuxkosaki
specific narg length calculation. * test/ruby/test_io.rb (test_ioctl_linux2): add new test for old and unstructured ioctl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-24* io.c (rb_io_reopen): re-initialize buffereing mode for stdout andakr
stderr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-24Merge branch 'fsync-nogvl' into trunkkosaki
Conflicts: ChangeLog git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-23* io.c (ioctl_narg_len): don't use _IOC_SIZE macro on Linux.naruse
On Linux some constants for ioctl(2) doesn't include the size of its return value and 16bit value; for example FIONREAD 0x541B. Moreover the manual, ioctl_list(2), says "Note that the size bits are very unreliable: in lots of cases they are wrong, either because of buggy macros using sizeof(sizeof(struct)), or because of legacy values." So we shouldn't use it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-21* io.c (linux_get_maxfd): get rid of a warning.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-21* io.c (linux_get_maxfd): new function to find maximum fd on Linux.akr
(rb_close_before_exec): use linux_get_maxfd. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18* io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it isusa
available (for Windows). * win32/win32.c (fcntl): on F_DUPFD, determine the inheritance of the new handle by O_NOINHERIT flag of original fd. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-16* io.c (argf_next_argv): wrong timing of setting ecflags.usa
fixed the failure of TestArgf#test_textmode introduced at r33662. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15* io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: useakr
__linux__ macro for consistency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (do_ioctl, ioctl_narg_len, setup_narg, rb_ioctl): usenobu
ioctl_req_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* ChangeLog, io.c: whitespace-cleanup.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (fcntl_narg_len): introduce narg calculation for fcntl insteadkosaki
of hard coded 256. * io.c (setup_narg): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (ioctl_narg_len): Linux doesn't have IOCPARM_LEN macro, butkosaki
has _IOC_SIZE. support it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (rb_ioctl): don't expose our sanity check value to ruby script.kosaki
It may change string value meaning if the value is string. (e.g. MacOS X has F_GETPATH ioctl) * io.c (rb_fcntl): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (ioctl_req_t): Type of req argument of ioctl() depend on platform.kosaki
Moreover almost all linux ioctl can't be represented by 32bit integer (i.e. MSB is 1). We need wrap ioctl argument type. [Bug #5429] [ruby-dev:44589] * io.c (struct ioctl_arg): ditto. * io.c (rb_ioctl): ditto. * test/ruby/test_io.rb (test_ioctl_linux): add a testcase for ioctl git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (struct io_cntl_arg): remove io_p member.kosaki
* io.c (nogvl_fcntl, do_fcntl, rb_fcntl): separated from ioctl functions. * io.c (nogvl_io_cntl): remove fcntl depended logic. * io.c (io_cntl): ditto. * io.c (rb_io_ctl): ditto. * io.c (rb_io_ioctl): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (setup_narg): fix off by one bug.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (+setup_narg): factor out length calculation logic.kosaki
* io.c (rb_io_ctl): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* io.c (+ioctl_narg_len) new helper function.kosaki
* io.c (rb_io_ctl): don't use ioctl specific length check if caller is fcntl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11* io.c (pipe_open): Remove fflush(stdin). it's no effect.kosaki
Pointed out by Ikegami Daisuke <ikegami.da@gmail.com>. Thank you. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09* io.c (rb_update_max_fd): fstat(2) can fail with other thannobu
EBADF. [ruby-dev:44837] [Backport #4339]. Cf. http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstat.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09* io.c (rb_sysopen): max fd is updated in rb_sysopen_internal()nobu
already. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08* io.c (io_fwrite): call rb_w32_write_console() only if FMODE_TTY isusa
set. this is the one of the reason of IO writing slowness of Windows in 1.9.3 or later. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07* include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,usa
ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro. * io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv): set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO if the flag is available. * io.c (make_writeconv): drop decorators for reading. * io.c (make_readconv): drop decorators for writing. * io.c (do_writeconv): existing writeconv is not the condition to raise ArgumentError. should check textmode or not. * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07* io.c (io_fflush): remove fsync().usa
* io.c (rb_io_flush, rb_io_rewind): fsync() here. these changes reduces fsync() calls to improve performance. first reported at [ruby-list:48515] by ak7 at mail.goo.ne.jp . [Bug #5585] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07* io.c (rb_close_before_exec): use F_MAXFD if available.akr
F_MAXFD is available on NetBSD since NetBSD 2.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05* io.c (rb_cloexec_fcntl_dupfd): don't clear try_dupfd_cloexec ifakr
fcntl(F_DUPFD) failed as fcntl(F_DUPFD_CLOEXEC). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04* whitespace cleanup.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03* io.c (make_writeconv): fixed typo of previous commit.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03* io.c (make_writeconv): fixed typo of previous commit.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03* io.c (make_writeconv): unversal_newline converter is for reading.usa
so, if the io is text mode and has ECONV_UNIVERSAL_NEWLINE_DECORATOR flag, use crlf_newline converter for writing. this change fixes the problem about the luck of CR up Kernel.p and Kernel.puts to stdout/stderr on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* io.c (rb_cloexec_pipe): remove workaround of r33587.naruse
The bug of NetBSD is fixed on Mon Oct 31 21:31:29 UTC 2011. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45545 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* io.c (rb_io_reopen): call rb_fd_fix_cloexec instead ofakr
rb_maygvl_fd_fix_cloexec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* io.c (rb_io_reopen): call rb_maygvl_fd_fix_cloexec after freopen().akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* io.c (nogvl_io_cntl): rb_cloexec_fcntl_dupfd's 2nd argument is int.naruse
* process.c (move_fds_to_avoid_crash): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* io.c (rb_maygvl_fd_fix_cloexec): renamed from fd_set_cloexec.akr
* internal.h (rb_maygvl_fd_fix_cloexec): declared. * ext/socket/init.c (cloexec_accept): use rb_maygvl_fd_fix_cloexec. (rsock_s_accept_nonblock): use rb_update_max_fd. (rsock_s_accept): use rb_update_max_fd. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31Fix previous commit (r33586).naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* io.c (rb_cloexec_pipe): NetBSD 6.0 will support pipe2(2),naruse
but its return value is -1 or larger than 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e