NetBSD-Bugs archive
[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>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/54564: cp of a fifo yields an empty file
Date: Tue, 24 Sep 2019 00:18:00 +0700
Date: Mon, 23 Sep 2019 14:40:00 +0000 (UTC)
From: jschauma%netmeister.org@localhost
Message-ID: <20190923144000.CE16B7A202%mollari.NetBSD.org@localhost>
copy_file() in /bin/cp first stat's the source, and if it is empty
(size 0), simply makes the output file, and exits. It never attempts
any kind of read - though it much prefers to use mmap() over read()
preferring read() only if the file is too big to mmap() sanely.
It should probably be smarter about the type of file it is copying,
and simply read()/write() to EOF on the read() for anything that
isn't a regular file.
kre
Home |
Main Index |
Thread Index |
Old Index