Subject: Re: What should stat("",&fs) return?
To: John Birrell <cimaxp1!jb@melb.werple.net.au>
From: John F. Woods <jfw@funhouse.com>
List: current-users
Date: 05/30/1996 08:15:06
> I just came across some code that (because of another bug) tries
> to stat() a null string. And NetBSD (i386 and alpha) returns zero
> from this test:
> OSF/1 and HPUX return -1 with errno = ENOENT. I would have expected
> NetBSD to behave the same way. Am I missing something?

Having had to "fix" this in another operating system because of a customer
who was too lazy to repair the broken application:  as I recall, the behavior
of considering a null string an error originated in System III; BSD provides
the historical behavior of considering it a synonym for ".".  I think HPUX is
System V derived; OSF/1, though mostly BSD derived, has caved into the AT&T
horde on many issues, including this one.

As to what it *should* return:  if there are any standards documents to which
NetBSD claims conformance that specify ENOENT, then that's what it should
return.  If the standards *don't* specify, then I personally prefer the
approach currently taken.