Commit 263d5b54 authored by Pavan Balaji's avatar Pavan Balaji Committed by Antonio J. Pena
Browse files

Promote MPL_large_writev/readv return types to ssize_t.



We were originally returning "int" from these functions because the
idea was that they'd never read/write more than INT_MAX.  However, in
the case where the upper layer passes an IOV, where the first element
is smaller than INT_MAX, but the next element is larger than INT_MAX,
the total number of bytes sent might be larger than INT_MAX.

This was occassionally showing up as an error on Mac OS for large
message communication.
Signed-off-by: default avatarAntonio J. Pena <apenya@mcs.anl.gov>
parent 2b975462
......@@ -34,8 +34,8 @@ extern "C" {
#endif
/* *INDENT-OFF* */
int MPL_large_writev(int fd, const struct iovec *iov, int iovcnt);
int MPL_large_readv(int fd, const struct iovec *iov, int iovcnt);
ssize_t MPL_large_writev(int fd, const struct iovec *iov, int iovcnt);
ssize_t MPL_large_readv(int fd, const struct iovec *iov, int iovcnt);
/* *INDENT-ON* */
#if defined(__cplusplus)
......
......@@ -16,7 +16,7 @@
* negligible compared to the system call overhead for small messages
* and compared to the data transmission overhead for large
* messages. */
int MPL_large_writev(int fd, const struct iovec *iov, int iovcnt)
ssize_t MPL_large_writev(int fd, const struct iovec *iov, int iovcnt)
{
ssize_t total_size, tmp;
struct iovec dummy;
......@@ -68,7 +68,7 @@ int MPL_large_writev(int fd, const struct iovec *iov, int iovcnt)
}
int MPL_large_readv(int fd, const struct iovec *iov, int iovcnt)
ssize_t MPL_large_readv(int fd, const struct iovec *iov, int iovcnt)
{
ssize_t total_size, tmp;
struct iovec dummy;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment