[08/26] Linux: sched_getaffinity syscall number is always available

Message ID 2b192006102b7d73fe50bb47dfffb35929eee64b.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_sched_getaffinity is always defined.
---
 sysdeps/unix/sysv/linux/sched_getaffinity.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

-- 
2.24.1

Comments

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


LGTM, thanks. 

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


> ---

>  sysdeps/unix/sysv/linux/sched_getaffinity.c | 10 +++-------

>  1 file changed, 3 insertions(+), 7 deletions(-)

> 

> diff --git a/sysdeps/unix/sysv/linux/sched_getaffinity.c b/sysdeps/unix/sysv/linux/sched_getaffinity.c

> index 6d79a41c34..325bfb29c1 100644

> --- a/sysdeps/unix/sysv/linux/sched_getaffinity.c

> +++ b/sysdeps/unix/sysv/linux/sched_getaffinity.c

> @@ -24,11 +24,10 @@

>  #include <shlib-compat.h>

>  

>  

> -#ifdef __NR_sched_getaffinity

> -# if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)

> +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)

>  extern int __sched_getaffinity_new (pid_t, size_t, cpu_set_t *);

>  libc_hidden_proto (__sched_getaffinity_new)

> -# endif

> +#endif

>  

>  int

>  __sched_getaffinity_new (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)

> @@ -48,7 +47,7 @@ versioned_symbol (libc, __sched_getaffinity_new, sched_getaffinity,

>  		  GLIBC_2_3_4);

>  

>  

> -# if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)

> +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)

>  libc_hidden_def (__sched_getaffinity_new)

>  

>  int

> @@ -59,7 +58,4 @@ __sched_getaffinity_old (pid_t pid, cpu_set_t *cpuset)

>    return __sched_getaffinity_new (pid, 128, cpuset);

>  }

>  compat_symbol (libc, __sched_getaffinity_old, sched_getaffinity, GLIBC_2_3_3);

> -# endif

> -#else

> -# include <posix/sched_getaffinity.c>

>  #endif

>

Patch

diff --git a/sysdeps/unix/sysv/linux/sched_getaffinity.c b/sysdeps/unix/sysv/linux/sched_getaffinity.c
index 6d79a41c34..325bfb29c1 100644
--- a/sysdeps/unix/sysv/linux/sched_getaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_getaffinity.c
@@ -24,11 +24,10 @@ 
 #include <shlib-compat.h>
 
 
-#ifdef __NR_sched_getaffinity
-# if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
+#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
 extern int __sched_getaffinity_new (pid_t, size_t, cpu_set_t *);
 libc_hidden_proto (__sched_getaffinity_new)
-# endif
+#endif
 
 int
 __sched_getaffinity_new (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
@@ -48,7 +47,7 @@  versioned_symbol (libc, __sched_getaffinity_new, sched_getaffinity,
 		  GLIBC_2_3_4);
 
 
-# if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
+#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
 libc_hidden_def (__sched_getaffinity_new)
 
 int
@@ -59,7 +58,4 @@  __sched_getaffinity_old (pid_t pid, cpu_set_t *cpuset)
   return __sched_getaffinity_new (pid, 128, cpuset);
 }
 compat_symbol (libc, __sched_getaffinity_old, sched_getaffinity, GLIBC_2_3_3);
-# endif
-#else
-# include <posix/sched_getaffinity.c>
 #endif