+ opos = out->pos + out->len;
+ if (flags & ICB_CIRCULAR_OUT) {
+ if (opos >= out->size) {
+ opos -= out->size;
+ ocnt = out->pos - opos - 1;
+ } else {
+ /* We only make use of the 4 bytes of overflow buffer
+ * if there is room to move the bytes to the start of
+ * the circular buffer. */
+ ocnt = out->size - opos + MIN((ssize_t)out->pos - 1, 4);
+ }
+ } else
+ ocnt = out->size - opos - 1;
+ obuf = out->buf + opos;