[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ENOEXEC from exec*() functions...?
From: |
Andreas Schwab |
Subject: |
Re: ENOEXEC from exec*() functions...? |
Date: |
Mon, 30 Jul 2018 13:16:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
On Jul 30 2018, Paul Smith <address@hidden> wrote:
> Which doesn't sound like something that would be helped by re-running
> as a shell script. Maybe this is a feature of GNU/Linux and other
> systems use ENOEXEC when there's no #! line?
http://pubs.opengroup.org/onlinepubs/9699919799/functions/execve.html
There are two distinct ways in which the contents of the process
image file may cause the execution to fail, distinguished by the
setting of errno to either [ENOEXEC] or [EINVAL] (see the ERRORS
section). In the cases where the other members of the exec family of
functions would fail and set errno to [ENOEXEC], the execlp() and
execvp() functions shall execute a command interpreter and the
environment of the executed command shall be as if the process
invoked the sh utility using execl() as follows:
execl(<shell path>, arg0, file, arg1, ..., (char *)0);
Andreas.
--
Andreas Schwab, SUSE Labs, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."