summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-11 13:44:31 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-11 13:44:31 +0000
commit43f910a9aa5f65312e18902de4464ba4069e9123 (patch)
tree8de78295d3a52c66f1810b47ed3df9bed8b384d0 /io.c
parentd9fdf58aaa0010657b486e1824f7a5cf023bc4ac (diff)
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/io.c b/io.c
index 361a488bc1..3350646d87 100644
--- a/io.c
+++ b/io.c
@@ -1801,6 +1801,16 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
* read_nonblock reads from the buffer like readpartial.
* In this case, read(2) is not called.
*
+ * read_nonblock can emulate blocking read as follows.
+ *
+ * begin
+ * result = io.read_nonblock(maxlen)
+ * rescue Errno::EINTR
+ * retry
+ * rescue Errno::EWOULDBLOCK, Errno::EAGAIN
+ * IO.select([io])
+ * retry
+ * end
*/
static VALUE
@@ -1832,6 +1842,16 @@ io_read_nonblock(int argc, VALUE *argv, VALUE io)
*
* If the write buffer is not empty, it is flushed at first.
*
+ * write_nonblock can emulate blocking write as follows.
+ *
+ * begin
+ * result = io.write_nonblock(string)
+ * rescue Errno::EINTR
+ * retry
+ * rescue Errno::EWOULDBLOCK, Errno::EAGAIN
+ * IO.select(nil, [io])
+ * retry
+ * end
*/
static VALUE