- * sbuf.len = sizeof(sbuf.inbuf);
- * sbuf.reader = io_new_conn(STDIN_FILENO,
- * io_read_partial(sbuf.inbuf, &sbuf.len,
- * wake_writer, &sbuf));
- * sbuf.writer = io_new_conn(tochild[1], io_idle());
- *
- * out.max = 128;
- * out.off = 0;
- * out.rlen = 128;
- * out.buf = malloc(out.max);
- * from_child = io_new_conn(fromchild[0],
- * io_read_partial(out.buf, &out.rlen,
- * read_from_child, &out));
- * if (!sbuf.reader || !sbuf.writer || !from_child)
- * err(1, "Allocating connections");
- *
- * io_set_finish(sbuf.reader, reader_exit, &sbuf);
- * io_set_finish(sbuf.writer, fail_child_write, &sbuf);
+ * // Read from stdin, write to child.
+ * memset(&to, 0, sizeof(to));
+ * reader = io_new_conn(STDIN_FILENO, read_in(NULL, &to));
+ * io_set_finish(reader, finish, &to);
+ * io_new_conn(tochild[1], write_out(NULL, &to));
+ *
+ * // Read from child, write to stdout.
+ * reader = io_new_conn(fromchild[0], read_in(NULL, &from));
+ * io_set_finish(reader, finish, &from);
+ * io_new_conn(STDOUT_FILENO, write_out(NULL, &from));