aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename FMODE_STRIP_BOM to FMODE_SETENC_BY_BOM.naruse2009-08-211-4/+4
| | | | | | | * include/ruby/io.h, io.c (FMODE_SETENC_BY_BOM): renamed from FMODE_STRIP_BOM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Change modestr syntax for BOM to "BOM|UTF-*".naruse2009-08-211-13/+7
| | | | | | | | | * io .c (rb_io_fmode_modestr): change modestr syntax for BOM to "BOM|UTF-*". * io.c (parse_mode_enc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_sysopen_internal): removed const qualifier.nobu2009-08-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_sysopen): moved sysopen_struct from rb_sysopen_internal.nobu2009-08-201-30/+44
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_stdio_set_default_encoding): prototyped.nobu2009-08-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set encodings of stdio after setting default internal and external.naruse2009-07-311-0/+11
| | | | | | | | | * io.c (rb_stdio_set_default_encoding): added. * ruby.c (process_options): call rb_stdio_set_default_encoding after setting defualt internal and external. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_eof): should call next_argv() before testing.matz2009-07-281-0/+1
| | | | | | [ruby-core:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_eof): go to the next file if called after ARGF.closenobu2009-07-261-0/+1
| | | | | | | or ARGF.skip. [ruby-core:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_eof): should not have reached EOF before trying tonobu2009-07-251-1/+1
| | | | | | | | read. based on a patch by Heesob Park <phasis AT gmail.com> at [ruby-core:24559]. [ruby-core:24557] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_open): add rdoc about specifying ext_enc as *-bom.naruse2009-07-201-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_read): should taint the result. [ruby-dev:38826]nobu2009-07-191-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-19/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_reopen): discards read buffer. [ruby-core:24240]nobu2009-07-161-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_free): free data body.ko12009-07-151-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): check if the descriptor can be accessednobu2009-07-141-5/+17
| | | | | | | in the specified open mode. [ruby-dev:38571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): handles leaked on win32 when an error occurs.usa2009-07-131-3/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-07-121-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (io_strip_bom): ungetbyte third byte when UTF-16LE.naruse2009-07-101-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix condition of second byte of UTF-16LE/UTF-32LE.naruse2009-07-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cosmetic changesnaruse2009-07-101-5/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set encoding and strip bom when modeenc string is "r:foo-bom" [ruby-dev:37236]naruse2009-07-091-2/+112
| | | | | | | | | | | | | | * include/ruby/io.h (FMODE_STRIP_BOM): new constant. * io.c (io_encname_bom_p): judge whether the encoding name is *-bom or not. (parse_mode_enc): drop "-bom". (rb_io_modestr_fmode): set FMODE_STRIP_BOM if needed. (rb_io_extract_modeenc): ditto. (io_strip_bom): strip bom if exists. (io_set_encoding_by_bom): set encoding if there is bom. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ext_int_to_encs): Set external encoding ifnaruse2009-07-071-1/+1
| | | | | | ext==intern. [ruby-dev:38278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_rewind): need to rewind $. and ARGF.lineno.matz2009-06-261-19/+18
| | | | | | | | [ruby-core:24046] * io.c (struct argf): refactoring on $. and ARGF.lineno behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_binmode_m): should call rb_io_ascii8bit_binmode() tomatz2009-06-251-2/+3
| | | | | | set its encoding to ASCII-8BIT. [ruby-core:24029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_each_codepoint): uninitialized local variable enc.matz2009-06-241-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2009-06-221-4/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: remove __CHECKER__ test.akr2009-06-221-1/+1
| | | | | | | | | | | | | | * dir.c: ditto. * dln.c: ditto. * file.c: ditto. * process.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/stringio/stringio.c (strio_each_codepoint): new method.matz2009-06-221-1/+101
| | | | | | | | [ruby-core:23949] * ext/stringio/stringio.c (strio_each_codepoint): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_fdatasync): new method IO#fdatasync.nobu2009-06-221-0/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-06-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-06-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_memsize): added.ko12009-06-161-0/+14
| | | | | | | | | | | | * io.c (rb_io_memsize): added. * regcomp.c (onig_memsize): added. * string.c (rb_str_memsize): added. * transcode.c (rb_transcoding_memsize, rb_econv_memsize): added. * variable.c (rb_geneic_ivar_memsize): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): revert last change. [ruby-dev:38648]matz2009-06-161-3/+3
| | | | | | * io.c (fptr_finalize): skip close(2) for fd 0,1,2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): should close stdin/stdout/stderr whenmatz2009-06-161-2/+2
| | | | | | | | closed explicitly. [ruby-core:23853] * io.c (argf_skip): should close only when current_file is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_each_line): should return self. [ruby-core:23852]matz2009-06-151-4/+3
| | | | | | * io.c (argf_each_byte, argf_each_char): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (Init_IO): add constant File::NOATIME. [ruby-core:23194]kazu2009-05-111-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): should be rb_pid_t.nobu2009-05-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: fixed types.nobu2009-04-261-61/+85
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_reopen): keeps pathv for prep_stdio. [ruby-dev:38131]nobu2009-04-261-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (rb_notimplement_body_p): declared.akr2009-04-161-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_method.c (Init_eval_method): suppress a warning. * io.c (rb_io_fsync): use rb_f_notimplement if not implemented. (rb_io_close_on_exec_p): ditto. (rb_io_set_close_on_exec): ditto. (rb_io_fcntl): ditto. (rb_f_syscall): ditto. * dir.c (dir_tell): ditto. (dir_seek): ditto. (dir_s_chroot): ditto. * process.c (proc_getpgrp): ditto. (proc_setpgrp): ditto. (proc_getpgid): ditto. (proc_setpgid): ditto. (proc_setsid): ditto. (proc_getpriority): ditto. (proc_setpriority): ditto. (proc_getrlimit): ditto. (proc_setrlimit): ditto. (p_sys_setuid): ditto. (p_sys_setruid): ditto. (p_sys_seteuid): ditto. (p_sys_setreuid): ditto. (p_sys_setresuid): ditto. (p_sys_setgid): ditto. (p_sys_setrgid): ditto. (p_sys_setegid): ditto. (p_sys_setregid): ditto. (p_sys_setreuid): ditto. (p_sys_setresgid): ditto. (p_sys_issetugid): ditto. (proc_getgroups): ditto. (proc_setgroups): ditto. (proc_initgroups): ditto. (proc_daemon): ditto. (rb_proc_times): ditto. * file.c (rb_file_s_lchown): ditto. (rb_file_s_link): ditto. (rb_file_s_symlink): ditto. (rb_file_s_readlink): ditto. (rb_file_s_truncate): ditto. (rb_file_truncate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_fd_select): new function to call selectmatz2009-04-011-5/+5
| | | | | | | | | | using rb_fdset_t. * io.c (select_internal): use rb_thread_fd_select instead of rb_thread_select. based on the patch from Kengo Matsuyama. [ruby-dev:38221] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-03-281-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_inspect): Cannot access fptr->fd if fptr is NULL.knu2009-03-241-1/+2
| | | | | | | | | This fixes a coredump caused by: ruby -e "class X < IO; def initialize; end; end; p X.new.inspect" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): should pass program name even if multiplenobu2009-03-201-1/+1
| | | | | | | arguments are given. fix for TestProcess::test_argv0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_mWaitReadable): defined.akr2009-03-191-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_mWaitWritable): defined. (io_getpartial): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. (rb_io_write_nonblock): extend IO::WaitWritable on EWOULDBLOCK and EAGAIN. * error.c (make_errno_exc): extracted from rb_sys_fail. (rb_mod_sys_fail): new function. * include/ruby/ruby.h (rb_mod_sys_fail): declared. (rb_mWaitReadable): declared. (rb_mWaitWritable): declared. * ext/socket/init.c (rsock_s_recvfrom_nonblock): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. (rsock_s_accept_nonblock): extend IO::WaitReadable on EWOULDBLOCK, EAGAIN, ECONNABORTED and EPROTO. * ext/socket/socket.c (sock_connect_nonblock): extend IO::WaitWritable on EINPROGRESS. * ext/socket/ancdata.c (bsock_sendmsg_internal): extend IO::WaitWritable on EWOULDBLOCK and EAGAIN. (bsock_recvmsg_internal): extend IO::WaitReadable on EWOULDBLOCK and EAGAIN. * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): raise SSLError extended by IO::WaitReadable/IO::WaitWritable on SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE. * ext/openssl/ossl.c (ossl_make_error): extracted from ossl_raise. (ossl_exc_new): new function. * ext/openssl/ossl.h (ossl_exc_new): declared. * lib/net/protocol.rb (rbuf_fill): rescue IO::WaitReadable and IO::WaitWritable. [ruby-core:22539], [ruby-dev:38140] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-03-171-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-03-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-03-171-4/+42
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (nogvl_copy_stream_read_write, copy_stream_body): use size_t.nobu2009-03-121-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu2009-03-121-2/+2
| | | | | | | | | | numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e