summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-31 05:12:23 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-31 05:12:23 +0000
commit4a3e62b3836a239089f87e0aed7058856026b793 (patch)
tree69daaa4ef19a65f9d727e97a07218b4ca24b64c8 /io.c
parentd5a47333d9a540957d82ccf8c181f05d62db13d4 (diff)
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/io.c b/io.c
index 5555de7c26..3b52966051 100644
--- a/io.c
+++ b/io.c
@@ -1899,6 +1899,17 @@ io_read_nonblock(int argc, VALUE *argv, VALUE io)
* The result may also be smaller than string.length (partial write).
* The caller should care such errors and partial write.
*
+ * # Creates a pipe.
+ * r, w = IO.pipe
+ *
+ * # write_nonblock writes only 65536 bytes and return 65536.
+ * # (The pipe size is 65536 bytes on this environment.)
+ * s = "a" * 100000
+ * p w.write_nonblock(s) #=> 65536
+ *
+ * # write_nonblock cannot write a byte and raise EWOULDBLOCK (EAGAIN).
+ * p w.write_nonblock("b") # Resource temporarily unavailable (Errno::EAGAIN)
+ *
* If the write buffer is not empty, it is flushed at first.
*
* When write_nonblock raises EWOULDBLOCK,