From: Andrei Tatar Date: Thu, 6 Feb 2025 13:05:37 +0000 (+0100) Subject: sockets.c: Use size_t for iovec length X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4efb424352d94a8b1aa638618f3d19c7f8dc575a;p=unikraft%2Flibs%2Flwip.git sockets.c: Use size_t for iovec length This change updates the lwip socket read/write ops to use unsigned size_t for the length of the passed-in iovec. The internal lwip read/write functions still use int, and simply package it into struct msghdr, which is size_t once again. If overflow is a concern we should fix it with a build patch. Signed-off-by: Andrei Tatar Reviewed-by: Sergiu Moga Approved-by: Razvan Deaconescu GitHub-Closes: #61 --- diff --git a/sockets.c b/sockets.c index f82da50..7eb0af1 100644 --- a/sockets.c +++ b/sockets.c @@ -343,7 +343,7 @@ lwip_posix_socket_sendto(posix_sock *file, const void *buf, static ssize_t lwip_posix_socket_read(posix_sock *file, const struct iovec *iov, - int iovcnt) + size_t iovcnt) { int lwip_fd; ssize_t ret; @@ -360,7 +360,7 @@ lwip_posix_socket_read(posix_sock *file, const struct iovec *iov, static ssize_t lwip_posix_socket_write(posix_sock *file, const struct iovec *iov, - int iovcnt) + size_t iovcnt) { int lwip_fd; ssize_t ret;