[18/26] Linux: getdents64 syscall number is always available on MIPS

Message ID f9a778269a7bcac0dde71f96958fe66311eb1022.1581279333.git.fweimer@redhat.com
State New
Headers show
Series
  • Linux cleanups enabled by built-in system call tables
Related show

Commit Message

Florian Weimer Feb. 9, 2020, 8:20 p.m.
Due to the built-in tables, __NR_getdents64 is always defined,
although it may not be supported at run time.
---
 sysdeps/unix/sysv/linux/mips/mips64/getdents64.c | 2 --
 1 file changed, 2 deletions(-)

-- 
2.24.1

Comments

Adhemerval Zanella Feb. 27, 2020, 11:31 p.m. | #1
On 09/02/2020 17:20, Florian Weimer wrote:
> Due to the built-in tables, __NR_getdents64 is always defined,

> although it may not be supported at run time.


LGTM, thanks. 

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


> ---

>  sysdeps/unix/sysv/linux/mips/mips64/getdents64.c | 2 --

>  1 file changed, 2 deletions(-)

> 

> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c

> index 4edf968b09..d18a5297dc 100644

> --- a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c

> +++ b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c

> @@ -34,7 +34,6 @@ __getdents64 (int fd, void *buf, size_t nbytes)

>    if (nbytes > INT_MAX)

>      nbytes = INT_MAX;

>  

> -#ifdef __NR_getdents64

>    static int getdents64_supported = true;

>    if (atomic_load_relaxed (&getdents64_supported))

>      {

> @@ -44,7 +43,6 @@ __getdents64 (int fd, void *buf, size_t nbytes)

>  

>        atomic_store_relaxed (&getdents64_supported, false);

>      }

> -#endif

>  

>    /* Unfortunately getdents64 was only wire-up for MIPS n64 on Linux 3.10.

>       If the syscall is not available it need to fallback to the non-LFS one.

>

Patch

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c
index 4edf968b09..d18a5297dc 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c
@@ -34,7 +34,6 @@  __getdents64 (int fd, void *buf, size_t nbytes)
   if (nbytes > INT_MAX)
     nbytes = INT_MAX;
 
-#ifdef __NR_getdents64
   static int getdents64_supported = true;
   if (atomic_load_relaxed (&getdents64_supported))
     {
@@ -44,7 +43,6 @@  __getdents64 (int fd, void *buf, size_t nbytes)
 
       atomic_store_relaxed (&getdents64_supported, false);
     }
-#endif
 
   /* Unfortunately getdents64 was only wire-up for MIPS n64 on Linux 3.10.
      If the syscall is not available it need to fallback to the non-LFS one.