[Top][All Lists]

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

[Bug-gnulib] Re: CVS update [cvs1-11-x-branch]: /ccvs/src/

From: Derek Robert Price
Subject: [Bug-gnulib] Re: CVS update [cvs1-11-x-branch]: /ccvs/src/
Date: Thu, 26 Aug 2004 12:10:41 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803

Hash: SHA1

Larry Jones wrote:

>>In an ideal world, we would probably move away from using the stdio
>>library entirely and use raw file operations such as the write() and
>>select() and pay close attention to the return values.
>Heavens, no!  Why should we write system-specific code to deal with
>non-blocking FDs when we don't need or want non-blocking behavior?  The
>right thing to do, as I said before, is to turn off non-blocking mode
>and continue to use stdio.

What about the case in question, when output is redirected, piped, and
some other program sets O_NONBLOCK?  Ideally, stdio would handle this,
but it currently does not.  We had a long discussion about this

Since I haven't heard anything about Paul Eggert's proposed STDIO
extension in the two intervening years, what would you say about my
writing one myself?  Something along the lines of fwrite_block(),
fputc_block(), & fputs_block() functions that always imitate blocking
behavior by watching for low byte count returns and responding with a
select() and a retry with any remaining data?  All fwrite_block()
calls would be converted to write objects of size 1 before calling the
system fwrite() so that we could depend on the file position indicator.

Ideally, I would contribute the code back to GNULIB and have it
supported there, but it could just as well be CVS specific.  Either
way, I would probably #define the original stdio function names to
call the new versions in a header a la unlocked-io.h but I'm open, of
course, to dissenting opinions about this.



- --

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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