apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject Re: svn commit: r399750 - /apr/apr/trunk/network_io/unix/sendrecv.c
Date Thu, 04 May 2006 16:28:37 GMT

Can we be sure that INT_MAX == 2GB ? What about I64 platforms like
Alpha?

On Thu, May 04, 2006 at 04:17:36PM -0000, jorton@apache.org wrote:
> ==============================================================================
> --- apr/apr/trunk/network_io/unix/sendrecv.c (original)
> +++ apr/apr/trunk/network_io/unix/sendrecv.c Thu May  4 09:17:36 2006
> @@ -269,6 +269,14 @@
>  
>  #else
>      off_t off = *offset;
> +
> +    /* Multiple reports have shown sendfile failing with EINVAL if
> +     * passed a >=2Gb count value on some 64-bit kernels.  It won't
> +     * noticably hurt performance to limit each call to <2Gb at a
> +     * time, so avoid that issue here: */
> +    if (sizeof(off_t) == 8 && *len > INT_MAX) {
> +        *len = INT_MAX;
> +    }
>  #endif
>  
>      if (!hdtr) {
> 
> 
> 

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Mime
View raw message