Re: GIOChannel & Intercepting stdout
- From: Lex Trotman <elextr gmail com>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: gtk-list gnome org
- Subject: Re: GIOChannel & Intercepting stdout
- Date: Fri, 27 Aug 2010 10:38:25 +1000
On 27 August 2010 09:47, Chris Vine <chris cvine freeserve co uk> wrote:
> On Thu, 26 Aug 2010 14:16:28 +0200
> Magnus Hjorth <magnus i hjorth gmail com> wrote:
>> Is the buffer really that small? I made a simple test program (below)
>> to check this out, and it seems that writes up to 64K work without
>> blocking on my Ubuntu system. Of course, it is still ugly (and
>> non-portable) to depend on this.
> I am extremely surprised that it is as large as 65536 in your case.
> POSIX requires PIPE_BUF to be at least 512, and on most unix-like
> systems it is 4096.
PIPE_BUF is the size of an guaranteed atomic write, not the pipe size.
Also it is not specified that the os can't do other buffering as
well, just like it does for disk devices. But it is also not
specified that it has to. So knowing when you might block is *very*
system dependent. Better not to depend on it.
> It is pretty astonishing that your example does not block.
> gtk-list mailing list
> gtk-list gnome org
] [Thread Prev