<div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 9, 2014 at 8:34 PM, Rob Landley <span dir="ltr"><<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Again, I don't know what the correct response is. Since this is<br>
something posix-2008 picked up from the gnu/dammit guys, it is of course<br>
badly specified. (The FSF is a political organization with only a<br>
vestigial software engineering effort attached, neither programming nor<br>
documentation are anywhere near their core competency.) Specifically,<br>
the man page's "ERRORS" section doesn't even mention -ENOMEM (let alone<br>
-EPIPE or -EIO)... In an out of memory situation or with an input error<br>
could it return a _short_ line? Discard partially read input if an error<br>
occurred partway into a line? Wazzit do?<br>
<br>
I _suppose_ on a certain level this is really libc's problem. Or at<br>
least as much libc's problem as the user's. But "juristictional<br>
arbitrage" does not solve problems.<br></blockquote><div><br><br></div><div>I suppose Toyboy could include in its config an optional safety valve that defines a GETLINE_MAX_LENGTH of a specified size, with a reasonable default. Upon setting this to -1, it would effectively default to the underspecified behaviour we're used to.<br></div><div><br></div><div>What the reasonable default limit should be is a bit of a question, but at least this way the packagers for a system could set a limit (or its absence) as makes sense for their requirements. If they can guarantee grep will never need to work on lines longer than 128kb, they'd specify that as its limit. Another user might prefer the unbounded case.<br><br></div><div>- Jeroen<br></div><div> </div></div>-- <br><div class="gmail_signature"><div dir="ltr"><kbd>↑</kbd><kbd>↑</kbd><kbd>↓</kbd><kbd>↓</kbd><kbd>←</kbd><kbd>→</kbd><kbd>←</kbd><kbd>→</kbd><kbd>B</kbd><kbd>A</kbd><kbd></kbd><br></div></div>
</div></div></div>