summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:18:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-01 03:18:03 +0000
commit683839054fad9935d362e5228d1d93e78c340699 (patch)
treea08815f2fc153a6f97648cbd1e882ba70cc2d0dd
parente4b53b22228d935847b72e8f9ab0f49a15b54215 (diff)
2000-02-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--io.c9
-rw-r--r--rubyio.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/io.c b/io.c
index 88c95a02c5..3476e1352c 100644
--- a/io.c
+++ b/io.c
@@ -167,6 +167,15 @@ rb_read_pending(fp)
return READ_DATA_PENDING(fp);
}
+void
+rb_read_check(fp)
+ FILE *fp;
+{
+ if (!READ_DATA_PENDING(fp)) {
+ rb_thread_wait_fd(fileno(fp));
+ }
+}
+
/* writing functions */
static VALUE
io_write(io, str)
diff --git a/rubyio.h b/rubyio.h
index 014ca4acd7..b0d9cda3ec 100644
--- a/rubyio.h
+++ b/rubyio.h
@@ -58,5 +58,6 @@ void rb_io_synchronized _((OpenFile*));
void rb_io_check_closed _((OpenFile*));
void rb_eof_error _((void));
+void rb_read_check _((FILE*));
int rb_read_pending _((FILE*));
#endif