lib/byteq.c
/* Writes as much of 'q' as possible to 'fd'.  Returns 0 if 'q' is fully
 * drained by the write, otherwise a positive errno value (e.g. EAGAIN if a
 * socket or tty buffer filled up). */
Writes as much of 'q' as possible to 'fd'.  Returns 0 if 'q' is fully
drained by the write, otherwise a positive errno value .
Writes as much of ' q ' as possible to ' fd ' . Returns 0 if ' q ' is fully drained by the write otherwise a positive errno value .
int
byteq_write(struct byteq *q, int fd)
{
    while (!byteq_is_empty(q)) {
        ssize_t n = write(fd, byteq_tail(q), byteq_tailroom(q));
        if (n > 0) {
            byteq_advance_tail(q, n);
        } else {
            ovs_assert(n < 0);
            return errno;
        }
    }
    return 0;
}
int byteq_write ( struct byteq * q , int fd ) { while ( ! byteq_is_empty ( q ) ) { ssize_t n = write ( fd , byteq_tail ( q ) , byteq_tailroom ( q ) ) ; if ( n > 0 ) { byteq_advance_tail ( q , n ) ; } else { ovs_assert ( n < 0 ) ; return errno ; } } return 0 ; }
Writes as much of 'q' as possible to 'fd'.
Writes as much of ' q ' as possible to ' fd ' .