You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1999/02/27 02:35:46 UTC

Re: cvs commit: apache-apr/apr/file_io/unix readwrite.c Makefile open.c

>  Added readwrite file, for all reading and writing functions, and made
>  minor changes to apr_close, so it works nicely with the rest of the file I/O
>  functions.

The interfaces don't look right to me.  Where possible, we should allow
the portability of ANSI C include files to do the work for us.  In other
words

>  apr_uint64_t apr_read(apr_file_t *thefile, void *buf, apr_uint64_t nbytes)

should be

   ssize_t apr_read(apr_file_t *thefile, void *buf, size_t nbytes)

and likewise for apr_write.  Note that it returns -1 on error.

....Roy

Re: cvs commit: apache-apr/apr/file_io/unix readwrite.c Makefile open.c

Posted by Dean Gaudet <dg...@arctic.org>.

On Fri, 26 Feb 1999, Roy T. Fielding wrote:

> >  Added readwrite file, for all reading and writing functions, and made
> >  minor changes to apr_close, so it works nicely with the rest of the file I/O
> >  functions.
> 
> The interfaces don't look right to me.  Where possible, we should allow
> the portability of ANSI C include files to do the work for us.  In other
> words
> 
> >  apr_uint64_t apr_read(apr_file_t *thefile, void *buf, apr_uint64_t nbytes)
> 
> should be
> 
>    ssize_t apr_read(apr_file_t *thefile, void *buf, size_t nbytes)
> 
> and likewise for apr_write.  Note that it returns -1 on error.

Except that ANSI C doesn't give us open64, lseek64/llseek, read64, ... we
could use apr_ssize_t, and apr_off_t and that would allow a recompile to
switch between 32-bit and 64-bit files.  (Yeah foo64() is a hack, I won't
deny that.)

Dean