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