apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Jacques Clar" <JJC...@novell.com>
Subject Re: [PATCH] apr_file_writev() on UNIX
Date Tue, 05 Oct 2004 17:23:35 GMT
>>> <jorton@redhat.com> 10/05/04 12:16 AM >>>
On Mon, Oct 04, 2004 at 06:11:57PM -0600, Jean-Jacques Clar wrote:
>> If HAS_WRITEV is not defined the current code
>> will just push the first vector to the target.
>> The function should write all the vectors or none.

>There is no guarantee that writev(2) writes all the vectors, it's
>allowed to return short just like write(2) is, so why should
>apr_file_writev() give such a guarantee only for the non-writev-based
If HAS_WRITEV is not defined, there is a bug inside apr_file_writev().
Only the first vector will be written to the file.
How do you think that bug should be fixed?
apr_file_writev() is used multiple times without alternatives in
and the current implementation is failing without informing the caller
or any
failure if writev() is not available. Do you see a better solution than
apr_file_writev() for that case?
Maybe the question is why do we need to have the HAS_WRITEV define?
Are there any Unix based system that do not have writev() implemented?

>What you're looking for, perhaps, is an apr_file_writev_full(), which
>guarantees "all bytes are written, or failure"?
I am not looking for replacement, there are vectors that needs to be
to a file in the current case.


View raw message