RFC - bootscript error reporting

Bill's LFS Login lfsbill at nospam.dot
Thu Jan 29 17:46:43 PST 2004


On Thu, 29 Jan 2004, Kevin P. Fleming wrote:

> Bill's LFS Login wrote:
>
> > I'm not sure about this one. I used to think that (true for real *IX).
> > IIRC, someone pointed out that if the open and writes are non-blocking,
> > the Linux kernel will let you proceed. But you see where my next point
> > will go, right? BTW, I *think* I tested that non-blocking hypothesis and
> > it was correct. But I would have to test again to confirm. And it may be
> > that the kernel lets you open, but blocks you on write. I *seem* to
> > recall that as the result of the test.
>
> I was just going by the latest man-page and info file for mkfifo, which
> could certainly be out of date. However, I suspect that the actual FIFO
> implementation in the kernel implies that there is no buffer in
> existence unless a reader is attached to the FIFO.

I've never dug into any kernel source to speak of (exception:
init/main.s lightly and a partially re-written NIC driver I maintain for
myself). What you say could be true. But I also would not be surprised
if there were a different scenario. When the writer opens the input
side of the of the FIFO, the driver could allocate buffers at that time.
This has the advantage of reducing possible race conditions vis-a-vis
children started by some process that is a little sloppy in its
procreation activities.

Then, when the reader side opens, its input is just attached to the
buffer already allocated. With a traditional circular buffer with
head/tail pointers, this seems reasonable. Or buffer swapping could be
used too. This could apply as well to a buffer list.

This works well regardless of which opens first, reader or writer. In
both cases the first allocated can act as either a traditional circular
buffer (not what I would design for a FIFO), a pair of buffers that are
swapped, or as the head of a list of buffers.

I only post conversationally at this time, as the wise thing is to get
one of the guys who dabble in the kernel all the time to provide an
answer. Not a lot of chance of that I think.

-- 
NOTE: I'm on a new ISP, if I'm in your address book ...
Bill Maltby
lfsbillATearthlinkDOTnet
Fix line above & use it to mail me direct.



More information about the lfs-dev mailing list