[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/54564: cp of a fifo yields an empty file
The following reply was made to PR bin/54564; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: bin/54564: cp of a fifo yields an empty file
Date: Tue, 24 Sep 2019 00:59:49 +0700
Date: Mon, 23 Sep 2019 17:30:01 +0000 (UTC)
From: Jan Schaumann <jschauma%netmeister.org@localhost>
| If cp(1) just creates an empty file and never reads,
| how come it blocks?
It does open the source file (that's needed for both mmap() and read()
versions) and uses fstat() rather than stat() for the size check.
I believe that a read mode open on a fifo blocks until a writer apepars,
but I am no fifo expert by any means, so this is just from a quick can
of the implementation.
That would explain the block - it isn't waiting for data to arrive, it
is waiting for a writer to arrive.
Main Index |
Thread Index |