diff mbox series

[v2,02/13] Linux: Assume __NR_execveat is defined in fexecve

Message ID 3e77d5b97883fb9c2d37e65f0b7416ce3b3e150c.1722193092.git.fweimer@redhat.com
State New
Headers show
Series getenv/environ thread safety | expand

Commit Message

Florian Weimer July 28, 2024, 7:02 p.m. UTC
It is available on all architectures.
---
 sysdeps/unix/sysv/linux/fexecve.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Adhemerval Zanella Netto Oct. 15, 2024, 7:15 p.m. UTC | #1
On 28/07/24 16:02, Florian Weimer wrote:
> It is available on all architectures.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/fexecve.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/fexecve.c b/sysdeps/unix/sysv/linux/fexecve.c
> index a62a757ec3..e0e5566fd7 100644
> --- a/sysdeps/unix/sysv/linux/fexecve.c
> +++ b/sysdeps/unix/sysv/linux/fexecve.c
> @@ -39,13 +39,11 @@ fexecve (int fd, char *const argv[], char *const envp[])
>        return -1;
>      }
>  
> -#ifdef __NR_execveat
>    /* Avoid implicit array coercion in syscall macros.  */
>    INLINE_SYSCALL (execveat, 5, fd, "", &argv[0], &envp[0], AT_EMPTY_PATH);
> -# ifndef __ASSUME_EXECVEAT
> +#ifndef __ASSUME_EXECVEAT
>    if (errno != ENOSYS)
>      return -1;
> -# endif
>  #endif
>  
>  #ifndef __ASSUME_EXECVEAT
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/fexecve.c b/sysdeps/unix/sysv/linux/fexecve.c
index a62a757ec3..e0e5566fd7 100644
--- a/sysdeps/unix/sysv/linux/fexecve.c
+++ b/sysdeps/unix/sysv/linux/fexecve.c
@@ -39,13 +39,11 @@  fexecve (int fd, char *const argv[], char *const envp[])
       return -1;
     }
 
-#ifdef __NR_execveat
   /* Avoid implicit array coercion in syscall macros.  */
   INLINE_SYSCALL (execveat, 5, fd, "", &argv[0], &envp[0], AT_EMPTY_PATH);
-# ifndef __ASSUME_EXECVEAT
+#ifndef __ASSUME_EXECVEAT
   if (errno != ENOSYS)
     return -1;
-# endif
 #endif
 
 #ifndef __ASSUME_EXECVEAT