summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2008-08-13* object.c (rb_obj_untrusted): new method Object#untrusted?.shugo
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-08* io.c (shutdown): not define if defined already.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-08* configure.in (shutdown, sched_yield, pthread_attr_setinheritsched):nobu
check for Haiku. * eval_intern.h, io.c, thread_pthread.c: use autoconfisticated results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-06* eval_intern.h: Add support to Haiku. see [ruby-core:18110]naruse
* include/ruby/defines.h: ditto. * configure.in: ditto. * thread_pthread.c: ditto. * io.c: ditto. * lib/mkmf.rb: ditto. * ext/socket/getaddrinfo.c: ditto. * ext/socket/extconf.rb: ditto. * ext/socket/socket.c: ditto. * ext/socket/addrinfo.h: ditto. * ext/socket/getnameinfo.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-05* array.c (rb_ary_sort_bang): reset to real class.nobu
* file.c (rb_find_file_ext, rb_find_file): ditto. * io.c (io_reopen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-05* io.c (retry_sendfile, retry_read): ENOSYS and EWOULDBLOCK are notnobu
defined on every platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29* io.c (io_ungetc): raise NotImplementedError when ungetc is calledmame
against dummy encoding IO. * io.c (rb_io_getline_1): ditto when gets with delimiter is called. * io.c (io_getc): ditto when getc is called. * test/ruby/test_io_m17n.rb (test_terminator_stateful_conversion, test_getc_stateful_conversion, test_ungetc_stateful_conversion): these tests should raise NotImplementedError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-21* io.c (prepare_getline_args): check if rs is a string when non-nilnobu
lim is given. [ruby-dev:35610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-16* io.c (appendline): remove invalid access.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-11* io.c (rb_io_wait_readable, rb_io_wait_writable): check if the filenobu
descriptor is closed. * thread.c (rb_thread_wait_fd_rw): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05rename rb_pipe_internal to rb_pipe.akr
use rb_pipe in pipe_nocrash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05* io.c (rb_pipe_internal): new function for handling EMFILE and ENFILEakr
error of pipe(). (UPDATE_MAXFD_PIPE): removed. (pipe_open): use rb_pipe_internal. (rb_io_s_pipe): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30* io.c (argf_each_line): pass args to each_line. [ruby-dev:34958]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-24 * io.c (io_reopen): remove cygwin handling because it seems to be forusa
C's stdio. fixed [ruby-dev:35183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-21 * io.c (rb_io_binmode_p, argf_binmode_p, Init_IO): new methodusa
IO#binmode? and ARGF.binmode? [ruby-dev:35148] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* io.c (rb_open_file): fs_encoding and fname_encoding isnaruse
rb_encoding *. fixed [ruby-dev:35151] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* io.c (rb_open_file): not rb_enc_get_index but rb_enc_get.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-16* io.c (io_set_encoding): defined.naruse
* io.c (rb_open_file): convert path on Windows and Mac OS X. * io.c (open_key_args): use io_set_encoding and now accept internal_encoding and exernal_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-11* io.c (read_all): should use io_read_encoding(), notmatz
io_input_encoding(). * io.c (rb_io_getline_1): reduce calling of io_read_encoding(). * string.c (rb_str_scan): need not to restore $~ value, so avoid pinning match object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-11* io.c (rb_io_reopen): clear read buffer.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-11* io.c (io_fread): bypass buffered read if reading buffer is empty.matz
* io.c (remain_size): do not add extra one byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* io.c (fptr_finalize): close IO object if fd is already closed.akr
(rb_p): call rb_io_write just once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-07* io.c (rb_f_open), re.c (rb_reg_search), transcode.c (str_transcode):nobu
suppress warnings. * util.c (quorem, rv_alloc, nrv_alloc): only used in dtoa(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 * io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.usa
fixed [ruby-dev:34979] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-02* re.c: fix SEGV by Regexp.allocate.names, Match.allocate.names, etc.mame
* test/ruby/test_regexp.rb: add tests for above. * io.c: fix SEGV by IO.allocate.print, etc. * test/ruby/test_io.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* suppress warnings with -Wwrite-string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29remove a compile error.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29* io.c (argf_readchar): raise EOFError, synchronizing IO#readchar.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29* io.c (argf_external_encoding, argf_internal_encoding): fix SEGV bymame
ARGF.external_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28* io.c (rb_getc): same as rb_read_check.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27* io.c (Init_IO): Define ARGF.{lines,bytes,chars}.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12* io.c (rb_f_gets.): re-enable rdoc.akr
(rb_f_readline): ditto. (rb_f_readlines): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 * process.c, include/ruby/intern.h (rb_run_exec_options): externed.usa
* process.c (save_redirect_fd, save_env_i, save_env, run_exec_dup2, run_exec_open, run_exec_pgroup, run_exec_rlimit, rb_run_exec_options): save parent's process environments. !!!remark!!! these are not thread-safe. * process.c (rb_spawn_internal): remove calling run_exec_options() because cannot restore after spawn. we'll fix this later. * io.c (pipe_open): ditto. * test/ruby/test_process.rb (test_execopts_env): upcase environment variable name for case insensitive platforms. * win32/win32.c (init_env): set USER environment variable only when USERNAME is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-11* thread.c (thread_cleanup_func_before_exec): extracted fromakr
thread_cleanup_func not to touch pthread data. pthread_cond_destroy in forked process may cause deadlock on Debian GNU/Linux Etch on x86, x86-64 and IA64. this doesn't cause resource leak because the process will exec soon. (terminate_atfork_before_exec_i): defined. (rb_thread_atfork_before_exec): defined. * include/ruby/intern.h (rb_thread_atfork_before_exec): declared. * process.c (rb_exec_atfork): call rb_thread_atfork_before_exec instead of rb_thread_atfork. * io.c (popen_exec): call rb_thread_atfork_before_exec instead of rb_thread_atfork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07* io.c (io_puts_ary): check recursion first. [ruby-dev:34580]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-05* io.c (io_fflush): IO#flush problem within threads. a patch frommatz
<s.wanabe at gmail.com> in [ruby-dev:34595]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-02* io.c (internal_read_func, internal_write_func): split fromnobu
internal_io_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-30* process.c (check_exec_redirect_fd): prohibit duplex IO.akr
(check_exec_fds): record maxhint even if close_others is not specified. (rb_exec_arg_fixup): renamed from rb_exec_arg_fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28* include/ruby/intern.h (rb_exec_arg_init): declared.akr
(rb_exec_arg_addopt): delared. (rb_exec_arg_fix): declared. (rb_exec_initarg): removed. (rb_exec_getargs): removed. (rb_exec_initarg2): removed. * io.c (struct popen_arg): make execarg as a pointer. (popen_exec): follow popen_arg change. (pipe_open): add eargp argument. extract argc and argv from eargp. use rb_exec_arg_addopt to add redirect options. (pipe_open_v): set up struct rb_exec_arg. (pipe_open_s): set up struct rb_exec_arg. * process.c (rb_exec_arg_addopt): new function extracted from check_exec_options_i. (check_exec_options_i): use rb_exec_arg_addopt. (rb_check_exec_options): opthash is always a hash now. (rb_exec_getargs): make it static. (rb_exec_fillarg): renamed from rb_exec_initarg2. don't set up redirect_fds. (rb_exec_arg_init): new function. (rb_exec_arg_fix): new function. (rb_f_exec): use rb_exec_arg_init and rb_exec_arg_fix. use rb_exec_arg_addopt to set close_others option. (run_exec_options): make close_others by default. (rb_spawn_internal): use rb_exec_arg_init and rb_exec_arg_fix. use rb_exec_arg_addopt to set close_others option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26* io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:nobu
suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-24* include/ruby/intern.h (rb_env_clear): declared.akr
(rb_io_mode_modenum): declared. (rb_close_before_exec): declared. (struct rb_exec_arg): add options and redirect_fds field. (rb_check_argv): removed. (rb_exec_initarg): declared. (rb_exec_getargs): declared. (rb_exec_initarg2): declared. (rb_fork): add third argument: fds. * io.c (max_file_descriptor): new static variable to record maximum file descriptor ruby used. (UPDATE_MAXFD): new macro. (UPDATE_MAXFD_PIPE): new macro. (rb_io_mode_modenum): externed. (rb_sysopen): update max_file_descriptor. (rb_close_before_exec): new function. (popen_exec): redirection removed because it is done by extended spawn mechanism. (pipe_open): generate a hash for spawn options to specify redirections. (pipe_open_v): use rb_exec_getargs. (pipe_open_s): use rb_exec_getargs. (rb_io_initialize): update max_file_descriptor.. * process.c (hide_obj): new function. (check_exec_redirect_fd): new function. (check_exec_redirect): new function. (check_exec_options_i): new function. (check_exec_fds): new function. (rb_check_exec_options): new function. (check_exec_env_i): new function. (rb_check_exec_env): new function. (rb_exec_getargs): new function. (rb_exec_initarg2): new function. (rb_exec_initarg): new function. (rb_f_exec): use rb_exec_initarg. (intcmp): new function. (run_exec_dup2): new function. (run_exec_close): new function. (run_exec_open): new function. (run_exec_pgroup): new function. (run_exec_rlimit): new function. (run_exec_options): new function. (rb_exec): call run_exec_options. (move_fds_to_avoid_crash): new function. (pipe_nocrash): new function. (rb_fork): use pipe_nocrash to avoid file descriptor conflicts. (rb_spawn): use rb_exec_initarg. (rlimit_resource_name2int): extracted from rlimit_resource_type. (rlimit_type_by_hname): new function. (rlimit_type_by_lname): new function. (rlimit_resource_type): use rlimit_type_by_hname. (proc_daemon): add fds argument for rb_fork. * hash.c (rb_env_clear): renamed from env_clear and externed. [ruby-dev:34086] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21* io.c (copy_stream_body): call rb_io_check_readable andakr
rb_io_check_writable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_func): suppress warnings.nobu
* thread_pthread.c (add_signal_thread_list): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_rbuf_to_dst): removed.akr
(copy_stream_fallback_body): don't bypass write method. (copy_stream_body): simplified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_fallback): write directly (bypassing write method)akr
if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20avoid warnings in copy_stream_body.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* io.c (copy_stream_fallback): read directly (bypassing readpartial)akr
if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19* io.c (copy_stream_body): use readpartial and write method forakr
non-IOs such as StringIO and ARGF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e