#ifndef _AFFINITY_H
#define _AFFINITY_H

#include <sched.h>
#include <unistd.h>
#include <linux/unistd.h>

/*
 * provide the proper syscall information if our libc is not yet updated.
 * It is suggested you check your kernel to make sure these are right for
 * your architecture.
 */
#ifndef __NR_sched_setaffinity

#if defined(__i386__)
#define __NR_sched_setaffinity	241
#define __NR_sched_getaffinity	242
#endif

#if defined(__powerpc__)
#define __NR_sched_setaffinity	223
#define __NR_sched_getaffinity	222
#endif

_syscall3(int, sched_setaffinity, pid_t, pid, unsigned int, len,
	  unsigned long *, user_mask_ptr)
_syscall3(int, sched_getaffinity, pid_t, pid, unsigned int, len,
	  unsigned long *, user_mask_ptr)

#endif /* __NR_sched_setaffinity */

#endif /* _AFFINITY_H */