[Toybox] od (was: Editors and such.)

Rob Landley rob at landley.net
Tue Jul 3 18:07:13 PDT 2012


On 07/01/2012 02:47 PM, Andre Renaud wrote:
>> If the output of od gets dropped (-EPIPE), what happens? Should it retry
>> short writes, which implies xprintf() should do an xmprintf() into a
>> malloc buffer and then do a writeall() on it, although I really am
>> trying to get automatic retry in there with sigaction(SA_RESTART) but
>> that doesn't protect you against _short_ writes, just spurious zero
>> length writes, and yes you can get that with "cat | cat" when you kill
>> -STOP and then kill -CONT them...
> 
> What is the response in general of other utilities to this behaviour?

It varies, but in this case:

$ od README > /dev/full
od: write error
od: write error: No space left on device

It notices, so I should probably xprintf().

> Is it the kind of thing you need to work around, or is it acceptable
> to have OD error out? I would have thought that if you kill -STOP
> something, it is conceivable that programs waiting for it's output
> would fail.

Nope. I have somewhat extensive experience with this due to

  http://copilotconsulting.com/mail-archives/uml.2005/msg01073.html
  http://lkml.indiana.edu/hypermail/linux/kernel/0503.3/1756.html

> Regards,
> Andre
> 

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1341364033.0


More information about the Toybox mailing list