mirror of https://github.com/n1nj4sec/pupy.git
Make compat sched calls static inline
This commit is contained in:
parent
6ef4ebd431
commit
45d31a5dea
|
@ -204,11 +204,13 @@ typedef struct
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
static inline cpu_set_t * __sched_cpualloc (size_t count) {
|
||||
static inline
|
||||
cpu_set_t * __sched_cpualloc (size_t count) {
|
||||
return malloc (__CPU_ALLOC_SIZE (count));
|
||||
}
|
||||
|
||||
static int __sched_cpucount (size_t setsize, const cpu_set_t *setp)
|
||||
static inline
|
||||
int __sched_cpucount (size_t setsize, const cpu_set_t *setp)
|
||||
{
|
||||
int s = 0;
|
||||
const __cpu_mask *p = setp->__bits;
|
||||
|
@ -246,6 +248,7 @@ static int __sched_cpucount (size_t setsize, const cpu_set_t *setp)
|
|||
return s;
|
||||
}
|
||||
|
||||
static inline
|
||||
void __sched_cpufree (cpu_set_t *__set) {
|
||||
free(__set);
|
||||
}
|
||||
|
|
|
@ -121,11 +121,13 @@ extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW;
|
|||
|
||||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
static inline
|
||||
int sched_setaffinity (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
|
||||
{
|
||||
return syscall(__NR_sched_setaffinity, 3, pid, cpusetsize, cpuset);
|
||||
}
|
||||
|
||||
static inline
|
||||
int sched_getaffinity (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
|
||||
{
|
||||
int res = syscall(__NR_sched_getaffinity, pid, MIN(INT_MAX, cpusetsize), cpuset);
|
||||
|
|
Loading…
Reference in New Issue