Closed SilvanScherrer closed 1 year ago
We should definitely change readv
and writev
to use IOV_MAX instead of a hard-coded value, as per Posix.
This is the original Silvan's ticket that describes where he faced it: http://trac.netlabs.org/ports/ticket/11.
see also for needed changes bevore the above fix https://github.com/bitwiseworks/libuv-os2/commit/ac6be5dce0484bf8a6f188a906784b3d40db2437
IOV_MAX which is 1024 is too big. In case of a socket, it may worse a performance if very large datum is passed. Because if total size of daum is bigger than buffer size of OS/2 socket(default 32768), then unnecessary buffer concatenation overhead of remaining datum occurs.
Anyway, any other macros for the same purpose are defined to 16. It would be better that IOV_MAX also has the same value.
limits.h:#define _XOPEN_IOV_MAX 16
sys/socket.h:#define MSG_MAXIOVLEN 16
both use
if (iovcnt <= 0 || iovcnt > 16)
which might be ok. But IOV_MAX itself is defined with 1024 in syslimits.h. This seems inconsistent to me.