mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 12:30:30 +00:00
Improve the affinity system calls
This commit is contained in:
parent
60b68d7152
commit
59ac141e49
19 changed files with 231 additions and 123 deletions
|
@ -1,13 +1,19 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_CALLS_SCHED_SYSV_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_CALLS_SCHED_SYSV_INTERNAL_H_
|
||||
#include "libc/calls/struct/sched_param.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define MAXCPUS_NETBSD 256
|
||||
#define MAXCPUS_FREEBSD 256
|
||||
#define MAXCPUS_OPENBSD 64
|
||||
#define P_ALL_LWPS 0 /* for effect on all threads in pid */
|
||||
|
||||
#define CPU_LEVEL_WHICH 3
|
||||
#define CPU_WHICH_TID 1
|
||||
#define CPU_WHICH_PID 2
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int sys_sched_get_priority_max(int);
|
||||
int sys_sched_get_priority_min(int);
|
||||
int sys_sched_getparam(int, struct sched_param *);
|
||||
|
@ -28,6 +34,12 @@ int sys_sched_setaffinity_netbsd(int, int, size_t, const void *) //
|
|||
int sys_sched_getaffinity_netbsd(int, int, size_t, void *) //
|
||||
asm("sys_sched_setaffinity");
|
||||
|
||||
int sys_sched_setaffinity_freebsd(
|
||||
int level, int which, int id, size_t setsize,
|
||||
const void *mask) asm("sys_sched_setaffinity");
|
||||
int sys_sched_getaffinity_freebsd(int level, int which, int id, size_t setsize,
|
||||
void *mask) asm("sys_sched_getaffinity");
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_SCHED_SYSV_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue