[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils-bug
Subject:    Re: [PATCH] dd: do not unnecesarilly allocate memory for input	block
From:       Pádraig Brady <P () draigBrady ! com>
Date:       2009-05-22 13:37:19
Message-ID: 4A16AA8F.2030800 () draigBrady ! com
[Download RAW message or body]

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.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic