summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/sched_getaffinity.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/libc/sysdeps/linux/common/sched_getaffinity.c b/libc/sysdeps/linux/common/sched_getaffinity.c
index 8982582cc..08545161a 100644
--- a/libc/sysdeps/linux/common/sched_getaffinity.c
+++ b/libc/sysdeps/linux/common/sched_getaffinity.c
@@ -16,20 +16,16 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <features.h>
-#ifdef __USE_GNU
-
-#include <sched.h>
-#include <sys/types.h>
#include <sys/syscall.h>
-#include <string.h>
-#include <sys/param.h>
-
-#if defined __NR_sched_getaffinity
-#define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
-static __inline__ _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid,
- size_t, cpusetsize, cpu_set_t *, cpuset)
+#if defined __NR_sched_getaffinity && defined __USE_GNU
+# include <sched.h>
+# include <string.h>
+# include <sys/types.h>
+# include <sys/param.h>
+# define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
+static __always_inline _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid,
+ size_t, cpusetsize, cpu_set_t *, cpuset)
int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
{
@@ -45,4 +41,3 @@ int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
return res;
}
#endif
-#endif