bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: better buffer size for copy


From: Jim Meyering
Subject: Re: better buffer size for copy
Date: Thu, 24 Nov 2005 08:58:07 +0100

Paul Eggert <address@hidden> wrote:

> address@hidden (Robert Latham) writes:
>
>> That's what i thought you'd say.  Ok, this patch vs. today's
>> CVS adds buffer-lcm.h and buffer-lcm.c, adds those files to
>> Makefile.am,  and makes copy.c call
>> buffer_lcm.
>
> That patch is a reasonable first cut, but it mishandles sparse files
> among other things.  I installed the following instead.  Thanks for
> prompting us to look into the problem.
>
> 2005-11-23  Paul Eggert  <address@hidden>
>
>       * src/copy.c: Improve performance a bit by optimizing away
>       unnecessary system calls and going to a block size of at least
...

Thanks for handling that.
I see that you too are adding declarations after statements :-)

>       {
> +       word *wp = NULL;
> +
> +       ssize_t n_read = read (source_desc, buf, buf_size);

For the record, we've discussed this before, but now there are
two files in coreutils/src that use the C99 feature allowing
declarations after statements: copy.c and remove.c.

The plan is that people stuck with compilers unable to deal
with that syntax will be able to apply a patch converting to
equivalent c89.  It may even happen automatically: if/when
configure detects the lack of a suitable compiler, it'd apply
the c99->c89 patch.  The only hitch is that we'll have to maintain
the patch manually, but that shouldn't involve too much work.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]