Re: execve() returns ENOENT when ld-linux.so isn't found

From: Olaf van der Spek
Date: Thu Mar 25 2010 - 15:29:23 EST


On Wed, Mar 24, 2010 at 11:45 PM, <drepper@xxxxxxxxx> wrote:
> On Wed, Mar 24, 2010 at 15:37, Olaf van der Spek <olafvdspek@xxxxxxxxx>
> wrote:
>>
>> Why not?
>> It's an improvement IMO, although it could be better.
>
> It's blatantly wrong. ÂThere is no dynamic linker. ÂENOEXEC means the file
> exists but is not of the right format.

That sounds closer to the actual error than ENOENT.

ENOENT: The file filename or a script or ELF interpreter does not
exist, or a shared library needed for file or interpreter cannot be
found.
ENOEXEC: An executable is not in a recognized format, is for the wrong
architecture, or has some other format error that means it cannot be
executed.

ENOENT shouldn't be overloaded like this, as it's common meaning is:
file not found. So it shouldn't be returned if the argument to execve
is actually found.

Olaf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/