Subject: Re: lib/222: stat(2) returns 0 for path=""
To: None <peter@taronga.com>
From: None <Jarle.F.Greipsland@idt.unit.no>
List: netbsd-bugs
Date: 04/10/1994 22:13:35
"pds" == Peter da Silva <peter@taronga.com> writes:
>> The behavior you described is correct.  The null string is considered
>> the same as `.', and thus `stat("", ...)' is the same as `stat(".",
>> ...)'.  This is not a bug.

> Doesn't POSIX discourage this behaviour, for some inscrutible reason? Or
> is that just one of those less-than-delightful quirks of System V?

Some datapoints:

ULTRIX lise8 4.2 0 RISC
stat "" returned 0

IRIX signy6 5.1.1.2 11021902 IP22 mips
stat "" returned -1

SunOS drue 4.1.3 2 sun4m
stat "" returned 0

NetBSD darling.idt.unit.no 0.9a DARLING#16 i386
stat "" returned 0

HP-UX juvel B.08.00 A 9000/43S 080009132396
stat "" returned -1

As the BSD derived systems seem to exhibit this, a bit counter-intuitive,
behaviour, maybe we should declare it "a good thing"?  As long as
the behaviour is documented I have no problems with either behaviour.
Maybe your acquaintance, Ms. POSIX, has? :-)

					-jarle
----
"Unix is not a "A-ha" experience, it is more of a "holy-shit"
 experience."
				-- Colin McFadyen in alt.folklore.computers



------------------------------------------------------------------------------