gst_writev: respect IOV_MAX for the writev iovec array
IEEE Std 1003.1-2001 specifies IOV_MAX as the maximum length of the writev(2) iovec array.
The current code is using the legacy value UIO_MAXIOV, which is generally but not always the same value.
On Solaris, IOV_MAX is 16 while UIO_MAXIOV is 1024. As a result, it is trivial to break gstreamer on Solaris (see below).
The writev(2) documentation on most systems specifies IOV_MAX: Linux, FreeBSD, Solaris... However, osx/ios specifies UIO_MAXIOV.
The proposed MR fixes this issue in the following way: If IOV_MAX is defined, we use it; otherwise, we fall back to UIO_MAXIOV.
Solaris failure test case:
gst-launch-1.0 filesrc location=in.mp4 ! filesink location=out.mp4
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstFileSink:filesink0: Could not write to resource.
Additional debug info:
/build/rtutils/components/desktop/gstreamer/gstreamer/gstreamer-1.16.0/plugins/elements/gstelements_private.c(346): gst_writev_buffers (): /GstPipeline:pipeline0/GstFileSink:filesink0:
Error while writing to file descriptor 3: Invalid argument
Execution ended after 0:00:00.000448929
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ... `