summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2002-10-29* eval.c, file.c, gc.c, io.c, object.c, ruby.c, ruby.h, struct.c,knu
ext/socket/socket.c: differentiate long and int; use proper printf type specifiers and do casts where appropriate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-27* djgpp/*: sync with the latest.eban
* ext/extmk.rb, lib/mkmf.rb: flush $stdout. * io.c (READ_DATA_PENDING_COUNT, READ_DATA_PENDING_PTR): undef these macros on DJGPP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-09* gc.c (gc_sweep): also adjust heaps_limits when free unused heapnobu
page. [ruby-core:00526] * io.c (io_fflush): condition to retry can occur. * io.c (io_write): returned 0 wrongly if no error occurred. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-08* io.c (io_write): must check returned value from fwrite() beforenobu
test with ferror(). (ruby-bugs-ja:PR#350) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-02* configure.in (RUBY_CHECK_IO_NEED_FLUSH): check whether fflush()nobu
is needed. * io.c (flush_before_seek): flush before seek if buffered data may remain. * io.c (rb_io_check_readable): flush if the last operation was write. * io.c (rb_io_check_writable): flush if the last operation was read. * rubyio.h (FMODE_RBUF): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-02* io.c (rb_io_wait_readable): handle retryable errors.nobu
* io.c (rb_io_wait_writable): ditto. * ext/socket/socket.c (bsock_send): ditto. * ext/socket/socket.c (s_recvfrom): ditto. * ext/socket/socket.c (s_accept): ditto. * ext/socket/socket.c (udp_send): ditto. * ext/socket/getaddrinfo.c (afdl): made private structures constant. * rubyio.h: prototype; rb_io_wait_readable(), rb_io_wait_writable(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-30* io.c (rb_io_inspect): not need to raise IOError for closed stream. ↵nobu
[ruby-talk:51871] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-25* io.c (appendline): forget to terminate with nul.matz
* eval.c (ruby_run): should set toplevel visibility again here. * eval.c (rb_eval): should not rely on ruby_class == rb_cObject check. Besides allow implicit publicity for attribute set methods. * parse.y (primary): need not to check class_nest, just set whether method is an attrset or not. * string.c (rb_str_each_line): p might be at the top of the string. * class.c (rb_make_metaclass): class of metaclass should be metaclass of superclass, unless class itself is a metaclass; class of metaclass of metaclass should point back to self. eh, confusing, isn't it. * class.c (rb_singleton_class): check if its class is singleton AND attached to self. * eval.c (rb_eval): should define class/module under ruby_cbase. * eval.c (rb_eval): should set class/module path based on ruby_cbase, not ruby_class. * eval.c (module_setup): use ruby_cbase instead of ruby_class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-17move struct timeval to missing.hmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-16* io.c: add parameter prototype.aamine
* re.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-11retry on EINTR, ERESTART and EWOULDBLOCK. [ruby-dev:17855], ↵nobu
[ruby-dev:17878], [ruby-core:00444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-06* io.c (rb_io_puts): RSTRING(line)->ptr might be NULL.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 * variable.c (rb_copy_generic_ivar): remove old generic instancematz
variable table if it existes. * class.c (rb_make_metaclass): metaclass of a metaclass is a metaclass itself. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-02read_all ftello (instead ftell) (ruby-core:392)michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-29* io.c (read_all): should use off_t instead of long.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28* io.c (appendline): data was lost when raw mode.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28adjust indetnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-28Int vs Long cleanup #3 (ruby-core:352)michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-27* file.c (rb_find_file): $LOAD_PATH must not be empty.matz
* file.c (rb_find_file_ext): ditto. * range.c (range_eq): class check should be based on range.class, instead of Range to work with Range.dup. * range.c (range_eql): ditto. * class.c (rb_mod_dup): need to preserve metaclass and flags. * object.c (rb_cstr_to_dbl): had a buffer overrun. * marshal.c (w_class): integrate singleton check into a funciton to follow DRY principle. * marshal.c (w_uclass): should check singleton method. * object.c (rb_obj_dup): dmark and dfree functions must be match for T_DATA type. * object.c (rb_obj_dup): class of the duped object must be match to the class of the original. * re.c (rb_reg_quote): do not escape \t, \f, \r, \n, for they are not regular expression metacharacters. * time.c (time_s_alloc): use time_free instead of free (null check, also serves for type mark). * time.c (time_s_at): check dfree function too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21*.c: Int vs Long cleanupmichal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-21* eval.c (rb_thread_cleanup): should not modify the globalmatz
variable curr_thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-20* replace of check EPIPE error(in getc()) rutine on bcc32.H_Konishi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-20* io.c (rb_io_putc): output via rb_io_write().matz
* re.c (rb_reg_initialize_m): frozen check should be moved here from rb_reg_initialize(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-16* io.c (NOFILE): define NOFILE as 64 if not defined.eban
* signal.c (sighandler_t): rename to sh_t on dietlibc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-08-16* io.c (rb_io_fread): renamed from io_fread and made extern.nobu
* marshal.c (r_bytes0): check if successfully read, use rb_io_fread() instead of fread() to be preemptive. (ruby-bugs-ja:PR#294, 295) * rubyio.h (rb_io_fread): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-28* io.c (pipe_finalize, pipe_popen): two-way pipe support for win32.usa
* win32/win32.c (ChildRecord, FindFreeChildSlot): ditto. * win32/win32.c, win32/win32.h (pipe_exec): new function for two-way pipe support for win32. * win32/win32.c, win32/win32.h (FindPipedChildSlot, rb_w32_popen, rb_w32_pclose): removed functions for two-way pipe support for win32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-11new platform [bccwin32] merged.H_Konishi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-29* parse.y: yyparse #defines moved from intern.hmatz
* ruby.c (proc_options): access prefixed "ruby_yydebug". * applied modifies to pacify some of gcc -Wall warnings. * parse.y (arg): no more ugly hack for "**", so that "-2**2" to be parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed as "-(2**2)". * parse.y (yylex): '-2' to be literal fixnum. [new] * time.c (time_succ): new method for Range support. * time.c (time_arg): nil test against v[6] (usec). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-23* ruby.c (proc_options): removed "-*-" support for #! line.matz
* io.c (rb_io_s_sysopen): new method to get a raw file descriptor. [new] * ext/socket/socket.c (tcp_sysaccept): new method to return an accepted socket fd (integer). [new] * ext/socket/socket.c (unix_sysaccept,sock_sysaccept): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-20* io.c (rb_io_clone): writing stream was not copied properly.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-05-02* error.c: use HAVE_DECL_SYS_NERR instead of platform names.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24* io.c (rb_io_mode_flags): both 'r+b' and 'rb+' should be allowed.matz
* io.c (rb_io_mode_modenum): ditto. * gc.c (rb_memerror): rename from mem_error, and exported. * gc.c (Init_GC): pre-allocate NoMemoryError instance. * object.c (convert_type): error message changed from "failed to convert" to "cannot convert", since it does not try to convert if an object does not respond to the converting method. * eval.c (block_pass): convert Method to Proc using rb_check_convert_type(). * object.c (rb_check_convert_type): always convert T_DATA * eval.c (rb_thread_cleanup): should not terminate main_thread by Fatal error. * regex.c (is_in_list): need to not exclude NUL and NEWLINE. * re.c (rb_reg_expr_str): wrong backslash escapement. * re.c (rb_reg_expr_str): do not escape embedded space characters. * marshal.c (w_object): T_DATA process patch from Joel VanderWerf <vjoel@PATH.Berkeley.EDU>. This is temporary hack; it remains undocumented, and it will be removed when marshaling is re-designed. * marshal.c (r_object): ditto. * numeric.c (num_step): Integer#step is moved to Numeric#step; Fixnum#step is merged into this method. * numeric.c (int_dotimes): Fixnum#times is merged. * numeric.c (int_upto): Fixnum#upto is merged. * numeric.c (int_downto): Fixnum#downto is merged. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-18* re.c (rb_reg_expr_str): should treat backslash specially inmatz
escaping. * io.c: complete off_t handling; missing argument for fptr_finalize(); polished rb_scan_args call. * dir.c: wrap multi-statment macro by do { } while (0) * eval.c, numeric,c, sprintf.c, util.c: ditto. * bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum, Bignum, nor Float. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-15* pack.c (pack_unpack): should treat 'U' in character unit, not inmatz
byte unit. * error.c (exc_initialize): should clear backtrace information. * io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd). * rubyio.h: remove FMODE_FDOPEN git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-12* struct.c (rb_struct_select): fix typo.matz
* io.c (io_write): check error if written data is less than specified size to detect EPIPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-11* io.c (remain_size): IO#read returns "" if file.size == 0.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-02* Makefile.in (CPPFLAGS): remove @includedir@.matz
* lib/mkmf.rb (create_makefile): ditto. * ext/extmk.rb.in (create_makefile): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-01* io.c (rb_io_fptr_cleanup): need flush even when io will not bematz
closed. * io.c (rb_io_initialize): was calling wrong function rb_io_mode_flags(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-01* re.c (match_setter): it's OK to assign nil to $~.matz
* io.c (rb_io_fptr_cleanup): do not close IO created by for_fd(). * io.c (rb_io_initialize): mark IO created by for_fd * ext/socket/socket.c (bsock_s_for_fd): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-29* io.c (io_fflush): DRY patch from /Christoph applied.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-28* ext/socket/socket.c (sock_addrinfo): should specify socktypematz
from outside. * io.c (argf_binmode): should call next_argv() to initialize ARGF. * io.c (argf_filename): ditto. * io.c (argf_file): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27* io.c (READ_DATA_PENDING): configure.in has supported for uClibc,eban
so remove uClibc stuff. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27typonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-27* io.c (rb_io_sysseek): new method based on a patch from Aristarkhmatz
A Zagorodnikov <xm@bolotov-team.ru>. [new] * io.c (READ_DATA_PENDING): use !feof(fp) for default behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-25* configure.in (FILE_READPTR): new. for IO#gets improvement.nobu
* io.c (READ_DATA_PENDING_PTR): ditto. * io.c (remain_size): separated from read_all(). * io.c (read_all): argument chagend. * io.c (appendline): new. get a line and append to string. * io.c (swallow): new. swallow continuous line delimiters. * io.c (rb_io_getline_fast): add delimiter argument. * io.c (rb_io_getline): performance improvement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-25* ext/socket/socket.c (bsock_do_not_rev_lookup_set): should not bematz
allowed when $SAFE > 3. * eval.c (rb_thread_ready): THREAD_TO_KILL threads should not turn into THREAD_RUNNABLE on wakeup. * eval.c (rb_thread_list): THREAD_TO_KILL threads should be in the list. * eval.c (thgroup_list): ditto; by moving gid clearance from rb_thread_cleanup(). * dir.c (fnmatch): "*/bar" (with FNM_PATHNAME flag) does not match "foo/bar". * io.c (read_all): files on /proc filesystem with zero stat size, may have contents. * ext/socket/socket.c (tcp_s_gethostbyname): refactored. * ext/socket/socket.c (sock_s_gethostbyname): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-22* the VMS support patch submitted by Akiyoshi, Masamichimatz
<Masamichi.Akiyoshi@jp.compaq.com> is merged. * eval.c (exec_under): changing ruby_class is OK, but should not alter cbase. * eval.c (yield_under_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14* re.c (rb_reg_match): should clear $~ if operand is nil.matz
* re.c (rb_reg_match2): ditto. * configure: merge Jonathan Baker's large file support patch [ruby-talk:35316], with read_all patch in [ruby-talk:35470]. * eval.c (rb_f_abort): optional message argument that be printed on termination. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-27* io.c (READ_DATA_PENDING): uClibc support.eban
* random.c (rand_init): ditto. * ext/socket/{addinfo.h,getaddrinfo.c} (gai_strerror): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-22* bignum.c (get2comp): need to specify to carry or not.matz
* io.c (rb_io_inspect): embed path info. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e