aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * prevent temporary objects from GC, and should not usenobu2011-02-201-2/+3
| | | | | | | 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
* * thread.c (rb_thread_io_blocking_region): new function to runnobu2011-02-121-4/+5
| | | | | | | 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
* * io.c (rb_io_s_sysopen): use NUM2MODET() instead NUM2UINT().kosaki2011-02-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fdatasync): Use fsync(2) if if the underlyingkosaki2011-02-021-4/+8
| | | | | | | | operating system does not support fdatasync(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (struct argf): char behaves like an unsigned char by default on AIX.kanemoto2011-01-301-1/+1
| | | | | | | 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
* * io.c (rb_io_open): Use NUM2MODET() instead NUM2UINT().kosaki2011-01-281-2/+2
| | | | | | | | * io.c (rb_scan_open_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_next_argv): go advance when the next file cannot benobu2011-01-131-1/+1
| | | | | | read. [ruby-core:34446] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_syscall): Add warning messages. [ruby-core:34062]kosaki2011-01-121-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_syscall): Some syscall return unsigned or pointer value.kosaki2011-01-121-1/+2
| | | | | | | | 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
* * io.c (rb_f_syscall): Add 64bit Linux support. Some syscall takeskosaki2011-01-121-0/+12
| | | | | | | | long type arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (Kernel.#syscall): implemented on LP64/LLP64 environments too.yugui2011-01-091-48/+72
| | | | | | | 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
* fix spaces.akr2011-01-081-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILEnobu2010-12-291-16/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typokazu2010-12-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (advice_arg_check): Change argument check.kosaki2010-12-251-5/+19
| | | | | | | | | 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
* * io.c (pipe_open): Added rb_thread_atfork(). We must reinitializekosaki2010-12-251-0/+1
| | | | | | | | | GVL at new process creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_extract_encoding_option): accept Encoding object asnobu2010-12-251-4/+12
| | | | | | encoding: optional argument. [ruby-dev:42884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c : add an extra byte to buffer for the specification of readtarui2010-12-201-36/+34
| | | | | | | | 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
* * io.c (Init_IO): Added O_DIRECT. This feature was propsed by Run ↵kosaki2010-12-191-0/+4
| | | | | | | | | | 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
* * io.c: removed garbage line.nobu2010-12-161-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_advise): removed unused variable, and fix indent.nobu2010-12-161-15/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix indentationkosaki2010-12-161-32/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_advise): New API. IO#advise() allows to tell thekosaki2010-12-161-0/+161
| | | | | | | | | | | | | | 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
* * io.c: parenthesize macro arguments.akr2010-12-161-12/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (nogvl_copy_stream_sendfile): fix missing condition.nobu2010-12-151-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (simple_sendfile): enable on Mac OS X.nobu2010-12-151-15/+30
| | | | | | | | * 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
* * io.c (simple_sendfile): improve linux compatibility on FreeBSD,naruse2010-12-141-5/+12
| | | | | | 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
* * io.c (simple_sendfile): disable the use of sendfile(2) onnaruse2010-12-131-3/+6
| | | | | | 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
* * io.c: define USE_SENDFILE on FreeBSD or DragonFly BSD.naruse2010-12-131-1/+3
| | | | | | 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
* * io.c (simple_sendfile): added for BSD version of sendfile(2).naruse2010-12-131-8/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): duplicate string if shared. [ruby-dev:42719]tarui2010-12-071-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (struct argf): make lineno long, and reorder members.nobu2010-11-281-6/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fwrite): use rb_w32_write_console under Windows.luislavena2010-11-271-0/+4
| | | | | | | * win32/win32.c (rb_w32_write_console): added to write to write Unicode using WriteConsoleW for stdout/stderr. [ruby-core:33166] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_buffer_t): extract from rb_io_t.nobu2010-11-181-198/+198
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_readlines): forward to current_file for argumentsnobu2010-11-141-4/+14
| | | | | | | check. http://twitter.com/nagachika/status/3634254856589312 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_close): untie tied io before closing.nobu2010-11-111-2/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_write): add ARGF.write and so on.nobu2010-11-111-1/+52
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_read_nonblock): add ARGF.read_nonblock.nobu2010-11-111-1/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_finalize): status is success if no process.nobu2010-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_readlines, rb_io_each_line): limit must not be zero.nobu2010-11-041-0/+4
| | | | | | a patch from Tomoyuki Chikanaga at [ruby-dev:42538]. #4024 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_select): change rdoc.naruse2010-10-211-16/+47
| | | | | | patched by Eito Katagiri [ruby-core:31805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_select): add correct rdoc.naruse2010-10-211-7/+17
| | | | | | patched by Dave Thomas [ruby-core:32467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ctl), parse.y (LVAR_USED): suppress warnings.nobu2010-10-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetc): always see Bignum. On 32bit valid valuenaruse2010-10-121-2/+0
| | | | | | may be a Bignum. On 64bit for errors. [ruby-dev:42366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetc): use unsigned int for GB18030.naruse2010-10-121-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_putc): support multibyte characters.naruse2010-10-121-3/+9
| | | | | | [ruby-core:30697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_set_encoding): use rb_funcall2 when the io is notnaruse2010-10-101-1/+6
| | | | | | a T_FILE. [ruby-dev:42356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): write_mutex might have been destroyednobu2010-10-061-3/+9
| | | | | | | | already in finalization phase, as the order of finalizers is not guaranteed. rb_mutex_t should be used in place of Mutex object in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_puts): fix for wide char encoding strings.nobu2010-09-151-1/+17
| | | | | | [ruby-dev:42212] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_scan_args): Add support for optional keywordknu2010-09-101-46/+26
| | | | | | | | | | | | | | | | | | | | argument hash. * README.EXT, README.EXT.ja: Update documentation accordingly. * dir.c (dir_initialize): Make use of the new rb_scan_args() feature. * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize) (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines) (rb_io_s_read, rb_io_set_encoding): Ditto. * transcode.c (str_transcode, econv_args) (econv_primitive_convert): Ditto. * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e