/*
* cpuset.h -- CPU affinity.
*
* Copyright (c) 2020, NLnet Labs. All rights reserved.
*
* See LICENSE for the license.
*
*/
#ifndef CPUSET_H
#define CPUSET_H
#ifdef HAVE_SCHED_H
# include <sched.h>
#endif
#ifdef HAVE_SYS_CPUSET_H
# include <sys/cpuset.h>
#endif
/*
* CPU affinity is currently only supported on Linux and FreeBSD. Other
* operating systems may be supported in the future, but not all operating
* systems offer the same functionality. OpenBSD for example does not support
* any kind of CPU affinity, while Solaris offers specifying a set of
* processors, but a processor can only be part of a single set.
*
* NOTE: On macOS Mojave, processor_set_create returned KERN_FAILURE which
* indicates processor allocation is not supported by the operating
* system.
*/