Граф коммитов

67 Коммитов

Автор SHA1 Сообщение Дата
nobu 45faa57b49 wait.c: wait_readable
* ext/io/wait/wait.c (io_wait_readable): add alias wait_readable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 13:53:02 +00:00
nobu e786aa711d io/wait: add IO#wait_writable method
* ext/io/wait/wait.c (io_wait_writable): this is easier to use than
  IO.select for a single IO object and is immune to the
  limitations/innefficiency of select() on platforms where poll/ppoll
  is available.  patched by Eric Wong.  [Feature #4646]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 13:40:00 +00:00
nobu b0dd250dc9 use RB_TYPE_P() instead of comparison of TYPE()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23 07:13:21 +00:00
nobu dd9569ded8 * ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOK
bits too.
* ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits.
  [ruby-dev:45309] [Bug #6116]
* ext/io/console/console.c (console_raw): fix rdoc.
* ext/io/console/console.c (console_set_echo): mentioned about
  platform dependency.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 01:11:47 +00:00
nobu 8335ce7065 * ext/io/console/console.c (io_getch): default delegating method
for StringIO.  https://github.com/nobu/io-console/issues/4
* ext/stringio/stringio.c: moved some methods to hidden modules.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25 18:24:09 +00:00
drbrain 12e7e79727 * io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]
* ext/io/console/console.c:  Mention that io/console must be required
  similar to lib/time.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 01:49:40 +00:00
nobu 714ec98ec4 * ext/io/console/console.c (console_raw, console_set_raw)
(console_getch): optional parameters.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 08:18:18 +00:00
nobu 3723ac22d2 * ext/io/console/console.c (console_cooked, console_set_cooked):
new methods to reset cooked mode.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 07:12:14 +00:00
akr da74bc7552 * process.c (ruby_setsid): use rb_cloexec_open.
(rb_daemon): ditto.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/io/console/console.c (console_dev): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 04:01:54 +00:00
akr 2bb5441808 * complex.c: use "__sun" instead of "__sun__" to detect SunOS.
* math.c: ditto.

* hash.c: ditto.

* atomic.h: ditto.

* ext/io/wait/wait.c: ditto.

[ruby-dev:44693]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24 14:57:08 +00:00
ngoto d332891fdd * ext/io/wait/wait.c: ioctl(2) is declared in unistd.h on Solaris.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23 07:51:10 +00:00
akr b574a4d4a1 * include/ruby/intern.h (rb_fd_set_cloexec): declared.
* io.c (rb_fd_set_cloexec): new function.
  (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
  (rb_sysopen_internal): ditto.
  (rb_pipe): ditto.
  (io_reopen): ditto.
  (io_cntl): ditto.

* process.c (rb_f_exec): change the default :close_others option to
  true.
  (rb_f_system): ditto.
  (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
  close-on-exec flag.
  (ruby_setsid): ditto.
  (rb_daemon): ditto.

* thread_pthread.c (rb_thread_create_timer_thread): call
  rb_fd_set_cloexec to set close-on-exec flag.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.

* ext/socket/init.c (rsock_socket): ditto.
  (rsock_s_accept_nonblock): ditto.
  (rsock_s_accept): ditto.

* ext/socket/socket.c (rsock_sock_s_socketpair): ditto.

* ext/socket/ancdata.c (discard_cmsg): ditto.
  (make_io_for_unix_rights): ditto.

* ext/socket/unixsocket.c (unix_recv_io): ditto.

* ext/io/console/console.c (console_dev): ditto.

[ruby-core:38140] [Feature #5041]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22 09:58:15 +00:00
nobu e6ce15c68a * ext/bigdecimal/bigdecimal.gemspec (files): fixed typo, and
removed nonexistent file.
* ext/bigdecimal/bigdecimal.gemspec (homepage): added.
* ext/io/console/io-console.gemspec (homepage): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-16 10:46:30 +00:00
nobu 4ac511266d * ext/io/console/console.c (console_set_winsize): remove
unused variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:54:14 +00:00
nobu 72276eb06b * remove unused variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 15:49:36 +00:00
akr b41ccc4a9c * include/ruby/intern.h (rb_update_max_fd): declaration moved from
internal.h.

* file.c: ditto.

* io.c: call rb_update_max_fd for each new fds.

* process.c: ditto.

* random.c: ditto.

* ruby.c: ditto.

* ext/io/console/console.c: ditto.

* ext/openssl/ossl_bio.c: ditto.

* ext/pty/pty.c: ditto.

* ext/socket/init.c: ditto.

* ext/socket/socket.c: ditto.

* ext/socket/ancdata.c: ditto.

* ext/socket/unixsocket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20 13:26:10 +00:00
nobu 3b8f9dc0b0 * ext/io/console/io-console.gemspec: spin-off gem for 1.9.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30 11:54:27 +00:00
usa 57ed1e9d75 * ext/io/console/console.c (console_dev): typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 14:51:25 +00:00
nobu 73c6b9d453 * ext/io/console/console.c (console_dev): console should be
unbuffered.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 14:33:36 +00:00
nobu a7b0b52f09 * ext/io/console/console.c (console_dev): take care of no-ctty
case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 14:28:53 +00:00
nobu 3254c1bf24 * ext/io/console/console.c (console_dev): fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 14:06:35 +00:00
nobu aef01ee789 * ext/io/console/lib/console/size.rb (IO#console_size): new
method.  (EXPERIMENTAL)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 13:45:29 +00:00
kosaki cd796c609f * ext/io/wait/wait.c (io_wait): use rb_wait_for_single_fd().
The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04 01:09:08 +00:00
kosaki 2d2544c8e6 * include/ruby/intern.h (rb_thread_select): mark as deprecated.
* ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select
  instead of rb_thread_select.
* ext/socket/init.c (wait_connectable0): ditto.
* ext/readline/readline.c (readline_event): ditto.
* io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable,
  wait_writable): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30 11:15:15 +00:00
kosaki 78ea7afe97 * ext/io/nonblock/nonblock.c (io_nonblock_set): Avoid F_SETFL if
we're not changing the O_NONBLOCK bit. F_SETFL is an expensive
  operation since it needs to affect all processes with the same
  file object.
  The patch is written by Eric Wong. [ruby-core:35556]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-04 13:11:14 +00:00
naruse 3dbb97708b * ext/io/console/console.c (console_set_winsize):
surpress warning: shorten-64-to-32.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-24 01:25:19 +00:00
nobu f4234c9b8f * ext/io/console/console.c (console_set_winsize): new method to set
console size.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-31 23:01:46 +00:00
nobu c90d5be882 * ext/io/console/console.c (console_winsize): use GetWriteFD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-31 22:56:07 +00:00
nobu 0e24a11b59 * ext/io/console/console.c (setattr): should retry on EINTR.
[ruby-dev:42666]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01 22:08:41 +00:00
nobu 92cb7d0ad4 * include/ruby/intern.h (rb_time_interval): used in io/wait.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-14 04:23:31 +00:00
nobu c53664c84d .cvsignore: have not been used already. [Bug #3468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
usa 80b9fb5a7b * io/console/console.c (winsize_row): should return actual screen
size, not buffer size.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-06 12:47:18 +00:00
akr 415be47593 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-25 14:26:04 +00:00
nobu 30f637024b * ext/io/console/console.c (get_write_fd): return primary fd if no
io is tied for writing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 09:45:29 +00:00
nobu 552243aa15 * ext/io/console/console.c (console_set_echo, console_echo_p): use
primary fd.  [ruby-dev:41309]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 08:56:11 +00:00
nobu b44618d5e5 * ext/io/console/console.c (console_set_raw): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 15:54:17 +00:00
nobu 08bf7189f8 * ext/io/console/console.c (ttymode): reverted previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 15:35:43 +00:00
nobu 6f3830427d * ext/io/console/console.c (ttymode): save dupped file descriptors
and restore tty modes using them, so that original modes can be
  restored even if orignal fds are closed.  [ruby-dev:41225]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 14:07:32 +00:00
nobu 163f974208 * ext/io/console: imported. [ruby-dev:40897]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 04:05:39 +00:00
nobu c749e4fca2 * ext/io/nonblock: moved from ext/io/wait/lib.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-14 12:53:23 +00:00
matz d33298e524 * ext/io/wait/wait.c (io_nread): returns number of bytes available
for read.  response to feature request #936 in [ruby-core:20917].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 09:07:20 +00:00
matz 95327358ce * ext/io/wait/wait.c (io_ready_p): updated to follow RDoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 09:01:38 +00:00
nobu bcf61f58d5 * ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on
cygwin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26 09:11:40 +00:00
matz edebd815b0 * ext/curses/curses.c: should include <ruby/io.h>.
* ext/io/wait/wait.c: ditto.

* ext/openssl/ossl.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26 03:05:47 +00:00
usa a0e7746d78 * ext/io/wait/extconf.rb: check sys/socket.h for cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-24 08:05:06 +00:00
nobu ad494f67dd * ext/io/wait/wait.c (FIONREAD_POSSIBLE_P): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 03:58:09 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
nobu 5b10c170e5 * file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):
renamed from OpenFile.

* ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h,
  ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c,
  ext/readline/readline.c, ext/socket/socket.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 10:30:50 +00:00
nobu 006f77a2f1 * ext/io/wait/extconf.rb: suspicious checking_for.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-16 07:15:22 +00:00
drbrain 6322272cea Fix call-seq in RDoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-28 02:31:34 +00:00