1 /* 2 * sched_getcpu() for uClibc 3 * 4 * Copyright (C) 2011 Bernhard Reutner-Fischer <uclibc@uclibc.org> 5 * 6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. 7 */ 8 9 #include <stdlib.h> 10 #include <errno.h> 11 #include <sched.h> 12 #include <sysdep.h> 13 14 #if defined __NR_getcpu 15 int sched_getcpu(void)16sched_getcpu (void) 17 { 18 unsigned int cpu; 19 int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL); 20 21 return r == -1 ? r : cpu; 22 } 23 #endif 24