mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Consolidate sched_getcpu
This patch consolidates the sched_getcpu implementations across all arches (except tile, which requires its own). This patch removes the powerpc, x86_64 and x32 specific files and change the default linux one to use INLINE_VSYSCALL where possible (for ports that implements it).
This commit is contained in:
committed by
Adhemerval Zanella
parent
2a523216d5
commit
dd26c44403
@ -19,13 +19,17 @@
|
||||
#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_SYSCALL (getcpu, 3, &cpu, NULL, NULL);
|
||||
int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL);
|
||||
|
||||
return r == -1 ? r : cpu;
|
||||
#else
|
||||
|
Reference in New Issue
Block a user