[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: fork or printf problem



"Binand Raj S." wrote:

> Shridhar Daithankar forced the electrons to say:
> > Kernel takes care of that. printf need not worry about it. That's the
> > strength of unix. That's what you mean by 'everything is a file in
> > unix...'
>
> No Sridhar, stdio handles its own buffering.

i agree with you

> I think there is an ANSI
> requirement for this.

true

> Once the buffer is full,

i dont think like that, because stdio gives three types of buffering
    1. unbuffered
    2. line buffered
    3. fully buffered

> stdio calls write(2) with the
> full buffer.

for line buffered it calls write when '\n' caharacter arrives

> The kernel doesn't enter this picture...

true

>
>
> Of course, the kernel is free to buffer the write() calls, to minimise actual
> disk writes.

buffer cache concept - maurice bach chapter 3 buffer cache

> I think it does this in the case of socket writes...

but the concept of buffer cache applies to all disk devices and some block devices. but
somewhere i read that [may be in assandro rubini's book]  linux does not use buffer cache and
that is the reason its kernel is small.
some one clear me please

pratap

>

>
>
> Binand
>
> ---------------------------------------------
> Find out more about this and other Linux India
> mailing lists at http://lists.linux-india.org/