+ char *p;
+ int i = wb->iovcount, n = wb->bufcount, nafter;
+
+ /* check enough length */
+ nafter = n + length;
+ if (nafter > WRITEBUF_BUFSZ)
+ return 0;
+
+ /* get where to store */
+ p = &wb->buf[n];
+ if (i && p == (((char*)wb->iovec[i - 1].iov_base) + wb->iovec[i - 1].iov_len))
+ /* increase previous iovec */
+ wb->iovec[i - 1].iov_len += (size_t)length;
+ else if (i == WRITEBUF_COUNT_MAX)
+ /* no more iovec */