Date: Mon, 10 Oct 2022 17:33:35 +0000 From: "Roland Illig" <ril...@netbsd.org> Message-ID: <20221010173335.c3cccf...@cvs.netbsd.org>
| Document only the POSIX requirement for now, as I didn't find | information about _which_ ancient UNIX systems would corrupt the | filesystem on unlinking a directory. Everthinng before the rename() mkdir() and rmdir() sys calls were added, which was about 4.2bsd I think - and as I recall the ability remained for some time after those were added. Not sure when the UTS stream caught up, probably about the time when Sun switched SunOS to being SysV based. | http://man.cat-v.org/unix-1st/2/sys-unlink (1971) says: | > It is also illegal to unlink a directory (except for the super-user). That has always been true ... the function in make is for when make is being run as root - not needed otherwise. kre ps: I agree that sys calls and emulations thereof should always return non-zero (and hence true) in the error case (but not necessarily always 0 when successful). That is simply the way they work and always have.