about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sched_getaffinity.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/sched_getaffinity.c')
-rw-r--r--sysdeps/unix/sysv/linux/sched_getaffinity.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/sched_getaffinity.c b/sysdeps/unix/sysv/linux/sched_getaffinity.c
index 9850806298..d66b6faa55 100644
--- a/sysdeps/unix/sysv/linux/sched_getaffinity.c
+++ b/sysdeps/unix/sysv/linux/sched_getaffinity.c
@@ -25,12 +25,22 @@
 
 
 #ifdef __NR_sched_getaffinity
+# 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
+
 int
 __sched_getaffinity_new (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
 {
-  int res = INLINE_SYSCALL (sched_getaffinity, 3, pid,
-			    MIN (INT_MAX, cpusetsize), cpuset);
-  if (res != -1)
+  INTERNAL_SYSCALL_DECL (err);
+  int res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, pid,
+			      MIN (INT_MAX, cpusetsize), cpuset);
+  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err)))
+    return INLINE_SYSCALL_ERROR_RETURN (-INTERNAL_SYSCALL_ERRNO (res,
+								 err),
+					int, -1);
+  else
     {
       /* Clean the rest of the memory the kernel didn't do.  */
       memset ((char *) cpuset + res, '\0', cpusetsize - res);
@@ -44,6 +54,8 @@ versioned_symbol (libc, __sched_getaffinity_new, sched_getaffinity,
 
 
 # if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
+libc_hidden_def (__sched_getaffinity_new)
+
 int
 attribute_compat_text_section
 __sched_getaffinity_old (pid_t pid, cpu_set_t *cpuset)