bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] dd: do not unnecesarilly allocate memory for input block siz


From: Pádraig Brady
Subject: Re: [PATCH] dd: do not unnecesarilly allocate memory for input block size, when not needed
Date: Fri, 22 May 2009 14:37:19 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Ondřej Vašík wrote:
> Pádraig Brady wrote:
>> So that would not run skip(STDOUT_FILENO,...) if count==0.
>> Would this break existing scripts that for example used
>> this command to position a non seekable device?
>>
>>   dd count=0 of=/dev/tape seek=1234
> 
> Thanks for objection, you are right, my patch seems to be not correct
> way as it doesn't run that part and could break something. However - for
> many cases (when file_size && offset < OFF_T_MAX and file seekable)
> buffer allocation is not required in skip(), so it could be handled
> somehow for those cases even without buffer allocation...

Definitely possible to alloc the buffer closer to the actual read().
More invasive though, so I'll let you decide if it's worth it.

cheers,
Pádraig.




reply via email to

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