/Sri
On Sun, Sep 26, 2010 at 9:37 AM, Dave Hylands <dhylands@xxxxxxxxx> wrote:
Hi guys,
Actually, there are 3 buffering modes supported in userspace.
On Sat, Sep 25, 2010 at 5:08 PM, Philip Downer wrote:
> javad karabi wrote:
>>
>> I am very curious about this.
>> Where exactly does the "hello" text go, before it is 'flushed' ?
>> I am thinking that it gets put in some other buffer, then 'flushing' the
>> buffer does something
>> to the effect of memcpy the buffer to the framebuffer?
>
> stdout is buffered, the '\n' newline character means that fflush is called
> on stdout and so the buffer is flushed. You can turn the buffer off using
> "setbuf(stdout, NULL);" and the output will immediately be displayed.
1 - unbuffered. Every character is flushed out immediately
2 - line buffered. Characters are not flushed until a newline is encountered
3 - fully buffererd. Characters are not flushed until the buffer is filled.
In cases 2 or 3, if you perform an input operation, then any
unbuffered characters will be flushed.
Here's some documentation:
<http://linux.die.net/man/3/setvbuf>
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ
--
--
ÂKrishna Mohan B