gst_writev: Respect UIO_MAXIOV limit for the iov array

If we receive more than UIO_MAXIOV (1024 typically) buffers
in a single writev call, fall back to consolidating them
into one output buffer or multiple write calls.

This could be made more optimal, but let's wait until it's
ever a bottleneck for someone
This commit is contained in:
Jan Schmidt 2015-06-12 01:15:19 +10:00
parent abfcffde46
commit e08db722f5

View file

@ -105,7 +105,7 @@ gst_writev (gint fd, const struct iovec *iov, gint iovcnt, gsize total_bytes)
gssize written;
#ifdef HAVE_SYS_UIO_H
if (TRUE) {
if (iovcnt <= UIO_MAXIOV) {
do {
written = writev (fd, iov, iovcnt);
} while (written < 0 && errno == EINTR);