mirror of
https://github.com/fluencelabs/musl
synced 2025-06-23 19:52:01 +00:00
add sched_getcpu
This is a GNU extension, but a fairly minor one, for a system call that otherwise has no libc wrapper.
This commit is contained in:
committed by
Rich Felker
parent
29b1357537
commit
98d335735d
13
src/sched/sched_getcpu.c
Normal file
13
src/sched/sched_getcpu.c
Normal file
@ -0,0 +1,13 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <sched.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int sched_getcpu(void)
|
||||
{
|
||||
int r;
|
||||
unsigned cpu;
|
||||
|
||||
r = __syscall(SYS_getcpu, &cpu, 0, 0);
|
||||
if (!r) return cpu;
|
||||
return __syscall_ret(r);
|
||||
}
|
Reference in New Issue
Block a user