[Xcb] [PATCH] Allow xcb_send_request with >UIO_MAXIOV iovecs

Peter Harris pharris at opentext.com
Thu Aug 16 08:30:42 PDT 2012


On 2012-08-16 01:37, Alan Coopersmith wrote:
> On 08/15/12 03:21 PM, Peter Harris wrote:
>> This allows an application to do a scatter/gather operation on a large
>> image buffer to avoid the extra memcpy.
>>
>> MacOSX 10.6 mentions UIO_MAXIOV in the man page for writev, but does not
>> define it in any header. Use autoconf to test for MAX_IOV from
>> <limits.h> in that case.
> 
> Ick - the only UIO_MAXIOV definition I see on Solaris is a wholly unrelated
> one in pth.h that is many times larger than IOV_MAX

That's unfortunate.

> - can we check for IOV_MAX
> first and only fall back to UIO_MAXIOV if that's missing?

I did a bit more digging, and everything[1] non-Linux I could get my
hands on (old AIX, old HPUX, current OpenBSD) has IOV_MAX. Only OpenBSD
and Linux have UIO_MAXIOV in <sys/uio.h> (old AIX has it in
<sys/socket.h>?!).

I'm going to conclude that UIO_MAXIOV is an obsolete BSD-ism, and only
Linux (or is it glibc?) is still sufficiently out of date to not have
IOV_MAX. Therefore, I agree that IOV_MAX is the right thing to test first.

I'll respin and post a v3 patch.

Thanks,
 Peter Harris

[1] IRIX doesn't count. The ancient version I have handy doesn't have
either define. I'm pretty sure I'd rather just fall back to 16 there,
instead of calling sysconf(_SC_IOV_MAX)[2]
[2] Which at least OpenBSD doesn't have.
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list