summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/sched_setaffinity.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/sched_setaffinity.c')
-rw-r--r--libc/sysdeps/linux/common/sched_setaffinity.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/common/sched_setaffinity.c b/libc/sysdeps/linux/common/sched_setaffinity.c
index 927744ea5..3d513ef4b 100644
--- a/libc/sysdeps/linux/common/sched_setaffinity.c
+++ b/libc/sysdeps/linux/common/sched_setaffinity.c
@@ -32,12 +32,13 @@ static size_t __kernel_cpumask_size;
int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
{
size_t cnt;
+ int res;
+ size_t psize = 128;
+ void *p = alloca (psize);
+
if (unlikely (__kernel_cpumask_size == 0)) {
- INTERNAL_SYSCALL_DECL (err);
- int res;
- size_t psize = 128;
- void *p = alloca (psize);
+ INTERNAL_SYSCALL_DECL (err);
while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (),
psize, p),
INTERNAL_SYSCALL_ERROR_P (res, err)