write can only be written from one continuous array of unsigned char , which cannot be greater than PTRDIFF_MAX , which (on all real POSIX systems, and perhaps this is also required by POSIX ...?), equal to SIZE_MAX/2 . Thus, passing a value that will be negative if it is interpreted as a signed value is a programming error for starters - the transferred size is not consistent with the available space in the buffer.
In theory, readv and writev can perform I / O operations that exceed SIZE_MAX/2 , repeating the same iov buffers several times in the array, but if I remember correctly, they indicate a failure if the total size is larger than SSIZE_MAX .
R ..
source share