This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Use execveat syscall in fexecve
On Sep 11 2017, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote:
> I would prefer it to use INLINE_SYSCALL_CALL. And since the idea is not to
> clobber errno I think we can do:
>
> #ifdef __NR_execvat
> INTERNAL_SYSCALL_DECL (err);
> int val = INTERNAL_SYSCALL_CALL (execveat, fd, argv, envp, AT_EMPTY_PATH);
> if (INTERNAL_SYSCALL_ERROR_P (val, err) != ENOSYS)
> return -1;
> #endif
No, that would be wrong. Either the exec succeeds, then errno no longer
exits, otherwise errno needs to be set before we return.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."