| 1 | #ifndef _UST_COMPAT_H |
| 2 | #define _UST_COMPAT_H |
| 3 | |
| 4 | /* |
| 5 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 6 | * |
| 7 | * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
| 8 | * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
| 9 | * |
| 10 | * Permission is hereby granted to use or copy this program |
| 11 | * for any purpose, provided the above notices are retained on all copies. |
| 12 | * Permission to modify the code and to distribute modified code is granted, |
| 13 | * provided the above notices are retained, and a notice that the code was |
| 14 | * modified is included with the above copyright notice. |
| 15 | */ |
| 16 | |
| 17 | #include <sys/syscall.h> |
| 18 | |
| 19 | #ifdef __UCLIBC__ |
| 20 | #define __getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache) |
| 21 | static inline |
| 22 | int sched_getcpu(void) |
| 23 | { |
| 24 | int c, s; |
| 25 | |
| 26 | s = __getcpu(&c, NULL, NULL); |
| 27 | return (s == -1) ? s : c; |
| 28 | } |
| 29 | #endif /* __UCLIBC__ */ |
| 30 | #endif /* _UST_COMPAT_H */ |