diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/sched_getcpu.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/sched_getcpu.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c index 2eb99ec4b5..c019cfb3cf 100644 --- a/sysdeps/unix/sysv/linux/sched_getcpu.c +++ b/sysdeps/unix/sysv/linux/sched_getcpu.c @@ -18,22 +18,17 @@ #include <errno.h> #include <sched.h> #include <sysdep.h> - -#ifdef HAVE_GETCPU_VSYSCALL -# define HAVE_VSYSCALL -#endif #include <sysdep-vdso.h> int sched_getcpu (void) { -#ifdef __NR_getcpu unsigned int cpu; - int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); - - return r == -1 ? r : cpu; + int r = -1; +#ifdef HAVE_GETCPU_VSYSCALL + r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); #else - __set_errno (ENOSYS); - return -1; + r = INLINE_SYSCALL_CALL (getcpu, &cpu, NULL, NULL); #endif + return r == -1 ? r : cpu; } |