From Richard Stallman > If a buffer flush fails with EAGAIN during > printf, what should happen? > > printf should retry, perhaps after a short sleep, and thus more or > less emulate the behavior with an ordinary blocking descriptor.
If you want to emulate blocking behaviour, then why not USE blocking behaviour? It doesn't make any sense to make the default behaviour of non-blocking act like blocking. Now if you wanted to write a library that emulated 'soft-non-blocking' i.e. retry in a little bit, with a timeout, sure that would be fine, but blocking is blocking and non-b is non-b. anything inbetween should be a separate mode. If you're worried about printf, then use sprintf, dump it to a buffer, and then feed it out stdio yourself (or with a library or whatever). > If all stdio output functions handle EAGAIN by sleeping for a short time > and trying again, most user programs will be happy with the results. > The few that are not happy are those that should not use stdio. I disagree. sleeps are inherently evil. stdio is not 'special' that it needs different handling characteristics than any other file descriptor. What if stdio had been instead mapped to a file? a pipe? The app simply cannot tell the difference, and simply cannot be told to act differently because it's stdio - Kevin _______________________________________________ Bug-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-cvs