summaryrefslogtreecommitdiff
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.knu2008-06-081-4/+6
| | | | | | | fixed [ruby-dev:34979] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge changes from ruby_1_8 to reduce warnings and potentially improveknu2008-06-061-2/+11
| | | | | | | | | | | | | | | | | | | security. * mkconfig.rb: hide build path from rbconfig.rb. * util.c (ruby_strtod, dtoa): initialize more variables for error handling. * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique), (path2class, path2module): constified. * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings. * suppress warnings on cygwin, mingw and mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge from ruby_1_8.knu2008-05-311-14/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge from ruby_1_8.knu2008-05-271-1/+141
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge from ruby_1_8.knu2008-05-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rubyio.h (rb_io_t): renamed from OpenFile.nobu2008-04-151-79/+79
| | | | | | | | | | | * ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c, ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c, ext/socket/socket.c: ditto. * win32/win32.h: removed workaround for OpenFile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_find, enum_reject): Return an enumerator if noknu2008-04-141-3/+11
| | | | | | | | | | | | block is given. * io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach, argf_each_line, argf_each_byte): Ditto. * string.c (str_gsub): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_open_file): should check NUL in path.matz2008-01-281-17/+18
| | | | | | | | | | | | | | | | | | <http://www.rubyist.net/~matz/20080125.html#c01>. * io.c (rb_io_s_popen): ditto. * io.c (rb_io_reopen): ditto. * io.c (next_argv): ditto. * io.c (rb_io_s_foreach): ditto. * io.c (rb_io_s_readlines): ditto. * io.c (rb_io_s_read): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_mode_flags, rb_io_mode_modenum): Ignore encodingknu2008-01-211-0/+10
| | | | | | | options for forward compatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): clear errno first. [ruby-talk:284492]nobu2008-01-031-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]nobu2007-10-251-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_notimplement), io.c (pipe_open): removed definitenobu2007-04-041-1/+1
| | | | | | | articles and UNIX manual section from messages. [ruby-dev:30690] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): refined the message of NotImplementedError.nobu2007-04-041-13/+19
| | | | | | | [ruby-dev:30685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): raise NotImplementedError for command "-" onnobu2007-04-041-0/+2
| | | | | | | platforms where fork(2) is not available. [ruby-dev:30681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (struct rb_thread.locals): explicit as struct.nobu2007-03-241-1/+1
| | | | | | | | | | | | | | [ruby-core:10585] * eval.c, node.h (enum rb_thread_status, struct rb_thread, rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586] * file.c (chompdirsep): made an unprefixed name static. * io.c (io_fread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_syscall): Fix buffer overflow with syscallknu2007-02-131-0/+2
| | | | | | | arguments. [ruby-bugs:PR#8541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (ruby_dup): start GC on ENOMEM as well.matz2007-01-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r11453matz2007-01-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (ruby_dup): start GC on ENOMEM as well.matz2007-01-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): command name should not contain null bytes.matz2006-09-041-4/+3
| | | | | | | | | | | | | [ruby-dev:29421] * process.c (proc_spawn): ditto. * process.c (proc_spawn_n): ditto. * process.c (rb_f_system): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h: use ifdef (or defined) for macro constants that may ormatz2006-07-311-1/+1
| | | | | | | | may not be defined to shut up gcc's -Wundef warnings. [ruby-core:08447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_close): always calls "close" method of the receiver.matz2006-07-281-5/+8
| | | | | | | [ruby-core:6911] [ruby-core:8112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): avoid closing uninitialized file descriptors.matz2006-06-261-2/+13
| | | | | | | a patch from <tommy at tmtm.org> [ruby-dev:28600] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* avoid useless fcntl in rb_io_set_nonblock.akr2006-05-221-6/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rubyio.h (rb_io_set_nonblock): declared.akr2006-05-221-7/+123
| | | | | | | | | | | | | | | | | * io.c (rb_io_set_nonblock): new function. (io_getpartial): nonblocking read support. (io_read_nonblock): new method: IO#read_nonblock. (io_write_nonblock): new method: IO#write_nonblock. * ext/socket/socket.c (sock_connect_nonblock): new method: Socket#connect_nonblock. (sock_accept_nonblock): new method: Socket#accept_nonblock. (sock_recvfrom_nonblock): new method: Socket#recvfrom_nonblock. [ruby-core:7917] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update readpartial doc.akr2006-05-131-7/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* note EAGAIN on readpartial document.akr2006-05-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* doc update. [ruby-talk:186294]akr2006-03-281-1/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_forward): should not use frame->argv.matz2006-02-141-19/+21
| | | | | | | [ruby-core:07358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (READ_DATA_PENDING, READ_DATA_PENDING_COUNT): definedakr2006-01-131-0/+4
| | | | | | | for DragonFly BSD 1.4.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Tue Jan 11 15:00:00 2006 Ville Mattila <mulperi@iki.fi>akr2006-01-131-0/+13
| | | | | | | | | | | | | | | | | | | | | | | * io.c (READ_PENDING*): Support solaris 64-bit enviroments. Solaris defines a opaque FILE struct when compiling 64 bit binaries. This means that we dont have access to _ptr etc. members anymore. The solution by Steven Lumos is to define FILE64 that has needed members available. I've modified the origanal patch a bit so that it compiles both with gcc and now free sun studio 11 compiler and both amd64 and sparc. NOTE! We have to 64 bit solaris FILE structure time to time otherwise we'll get breakage. [ruby-core:7106] Fri Jan 6 10:16:20 2006 Steven Lumos <steven@lumos.us> * io.c (READ_DATA_PENDING): defined for 64bit Solaris on SPARC. [ruby-core:7057] (READ_DATA_PENDING_COUNT): ditto. (READ_DATA_PENDING_PTR): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_f_backquote): fix a GC problem onakr2005-12-191-1/+2
| | | | | | | IA64 with gcc 4.0.3 20051216 (prerelease) -O3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* precedes registering global VALUE variables before initializing it.akr2005-12-121-6/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/digest/digest.c (rb_digest_base_s_digest): add volatile tomatz2005-12-121-1/+1
| | | | | | | | | | | protect temporary context object. [ruby-dev:27979] * ext/iconv/iconv.c (Init_iconv): rb_gc_register_address() should be called before actual variable initialization. [ruby-dev:27986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, io.c: use sys/syscall.h if syscall.h is not available.nobu2005-10-241-0/+2
| | | | | | | [ruby-core:06247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c, pack.c, ext/syck/rubyext.c, ext/syck/syck.h, missing/isinf.c:nobu2005-10-131-0/+4
| | | | | | | get rid of warnings. fixed: [ruby-core:06247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]nobu2005-09-271-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: fixed rdoc. [ruby-Bugs:2523]ocean2005-09-271-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: PIPE_BUF is not defined on BeOS. use _POSIX_PIPE_BUF instead.ocean2005-09-201-0/+8
| | | | | | | [ruby-dev:27185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_close): call rb_io_close() directly if io is a T_FILEmatz2005-09-191-0/+4
| | | | | | | object. [ruby-dev:27156] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_thread_flock): wrap the flock system call byakr2005-09-181-0/+2
| | | | | | | | | | | | | | | TRAP_BEG/TRAP_END to enable signals. [ruby-dev:27122] * ext/socket/socket.c (bsock_send): wrap the sendto and send system call by TRAP_BEG/TRAP_END to enable signals when writing to a socket which is full. [ruby-dev:27132] * io.c (rb_io_syswrite): wrap the write system call by TRAP_BEG/TRAP_END to enable signals when writing to a pipe which is full. [ruby-dev:27134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fwrite): wrap the write system call by TRAP_BEG/TRAP_END toakr2005-09-181-0/+2
| | | | | | | enable signals when writing to a pipe which is full. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi.rb (CGI::Cookie): should handle multiple values for amatz2005-09-171-1/+1
| | | | | | | | | | | | | cookie name. [ruby-talk:156140] * string.c (rb_str_substr): should propagate taintness even for empty strings. [ruby-dev:27121] * string.c (rb_str_aref): should infect result if range argument is tainted. [ruby-dev:27121] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* document a blocking behavior of IO#eof?.akr2005-09-051-4/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: check HAVE_SYS_IOCTL_H before including the header.matz2005-07-251-1/+1
| | | | | | | [ruby-dev:26610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (S_ISREG): need to define S_ISREG before it is used first.usa2005-07-201-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use S_ISDIR.akr2005-07-201-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (wsplit_p): patch for the environment whereocean2005-07-201-3/+6
| | | | | | | | fcntl(F_GETFL, O_NONBLOCK) is not supported. in that case, set FMODE_WSPLIT without fcntl check. [ruby-dev:26566] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ctl): update FMODE_WSPLIT_INITIALIZED and FMODE_WSPLITakr2005-07-201-0/+10
| | | | | | | by F_SETFL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_inspect): replace sprintf() with "%s" format allmatz2005-07-191-1/+1
| | | | | | | | | | over the place by snprintf() to avoid integer overflow. * sample/svr.rb: service can be stopped by ill-behaved client; use tsvr.rb instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e