1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

2000-02-01

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-02-01 03:18:03 +00:00
parent e4b53b2222
commit 683839054f
2 changed files with 10 additions and 0 deletions

9
io.c
View file

@ -167,6 +167,15 @@ rb_read_pending(fp)
return READ_DATA_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 */ /* writing functions */
static VALUE static VALUE
io_write(io, str) io_write(io, str)

View file

@ -58,5 +58,6 @@ void rb_io_synchronized _((OpenFile*));
void rb_io_check_closed _((OpenFile*)); void rb_io_check_closed _((OpenFile*));
void rb_eof_error _((void)); void rb_eof_error _((void));
void rb_read_check _((FILE*));
int rb_read_pending _((FILE*)); int rb_read_pending _((FILE*));
#endif #endif