Messages in this thread | | | Date | Tue, 22 Sep 1998 09:14:56 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: execve changes break execlp with 2.1.122 |
| |
On Tue, 22 Sep 1998, Chris Wedgwood wrote: > > On Tue, Sep 22, 1998 at 12:53:33AM +0000, Linus Torvalds wrote: > > > and 2.1.123-1 will incorrectly return ENOTDIR (which while sensible is > > definitely incorrect), while a correct kernel will return ENOENT. > > Both are equally correct - software that break on one or other is > arguably broken.
No, POSIX (and before that just normal UNIX semantics) does clearly define that ENOENT is the only correct thing to return. I certainly agree that both make sense if you don't have any arbitrary rules, but we do have 25 years of UNIX.
And it's really easy for me to return the right error value, I just got an simple ordering issue wrong (and to some degree ENOENT really is the better return code anyway as it makes ENOTDIR tell you more - ENOTDIR really means that the path component existed but wasn't valid as a directory).
I do agree that this showed a instability in "execlp()", in that it only accepted ENOENT as a return value, and if execlp() ever got ENOTDIR instead it simply stopped searching the path. ENOTDIR is a valid return value even from a fixed kernel if the path contains any components that might not always be directories (and that is a valid thing to have: some people I know have a "./bin" entry in their path, and sometimes "." might have a file called "bin" in it).
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |