#include <mach/processor_set.h> also included by <mach/mach.h>

mach/processor_set.h

11 functions · 3 macros

macro_processor_set_user_

#define _processor_set_user_ 

macroprocessor_set_MSG_COUNT

#define processor_set_MSG_COUNT 11

functionprocessor_set_statistics

extern kern_return_t processor_set_statistics(
	processor_set_name_t pset,
	processor_set_flavor_t flavor,
	processor_set_info_t info_out, /* out */
	mach_msg_type_number_t *info_outCnt
)
Return scheduling statistics for a processor set.
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Return scheduling statistics for a processor set.
The processor_set_statistics function returns statistics for a processor set as specified by flavor.

functionprocessor_set_destroy

extern kern_return_t processor_set_destroy(processor_set_t set)
OBSOLETE interfaces, removed from kernel
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Destroy the target processor set object.
The processor_set_destroy function destroys the specified processor set. Any assigned processors, tasks or threads are re-assigned to the default set. The object port (not the name port) for the processor set is required.
KERN_DEFAULT_SETAn attempt was made to destroy the default processor set.

functionprocessor_set_max_priority

extern kern_return_t processor_set_max_priority(
	processor_set_t processor_set,
	int max_priority,
	boolean_t change_threads
)
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Sets the maximum scheduling priority for a processor set.
The processor_set_max_priority function sets the maximum scheduling priority for processor_set. The maximum priority of a processor set is used only when creating new threads. A new thread's maximum priority is set to that of its assigned processor set. When assigned to a processor set, a thread's maximum priority is reduced, if necessary, to that of its new processor set; its current priority is also reduced, as needed. Changing the maximum priority of a processor set does not affect the priority of the currently assigned threads unless change_threads is TRUE. If this priority change violates the maximum priority of some threads, their maximum priorities will be reduced to match.

functionprocessor_set_policy_enable

extern kern_return_t processor_set_policy_enable(
	processor_set_t processor_set,
	int policy
)
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Enables a scheduling policy for a processor set.
The processor_set_policy_enable function extends the set of scheduling policies allowed for processor_set. The set of scheduling policies allowed for a processor set is the set of policies allowed to be set for threads assigned to that processor set. The current set of permitted policies can be obtained from processor_set_info.

functionprocessor_set_policy_disable

extern kern_return_t processor_set_policy_disable(
	processor_set_t processor_set,
	int policy,
	boolean_t change_threads
)
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Disables a scheduling policy for a processor set.
The processor_set_policy_disable function restricts the set of scheduling policies allowed for processor_set. The set of scheduling policies allowed for a processor set is the set of policies allowed to be set for threads assigned to that processor set. The current set of permitted policies can be obtained from processor_set_info. Timesharing may not be forbidden for any processor set. This is a compromise to reduce the complexity of the assign operation; any thread whose policy is forbidden by its target processor set has its policy reset to timesharing. Disabling a scheduling policy for a processor set has no effect on threads currently assigned to that processor set unless change_threads is TRUE, in which case their policies will be reset to timesharing.

functionprocessor_set_tasks

extern kern_return_t processor_set_tasks(
	processor_set_t processor_set,
	task_array_t *task_list, /* out */
	mach_msg_type_number_t *task_listCnt
)
List all tasks in processor set.
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Return a list of pointers to all tasks currently assigned to the target processor set.
The processor_set_tasks function returns send rights to the kernel ports for each task currently assigned to processor_set.

functionprocessor_set_threads

extern kern_return_t processor_set_threads(
	processor_set_t processor_set,
	thread_act_array_t *thread_list, /* out */
	mach_msg_type_number_t *thread_listCnt
)
OBSOLETE interfaces, removed from kernel
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Return a list of pointers to all threads currently assigned to the target processor set.
The processor_set_threads function returns send rights to the kernel ports for each thread currently assigned to processor_set.

functionprocessor_set_policy_control

extern kern_return_t processor_set_policy_control(
	processor_set_t pset,
	processor_set_flavor_t flavor,
	processor_set_info_t policy_info,
	mach_msg_type_number_t policy_infoCnt,
	boolean_t change
)
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Set target processor set's scheduling policy state.
The processor_set_policy_control function controls scheduling attributes governing the processor set.

functionprocessor_set_stack_usage

extern kern_return_t processor_set_stack_usage(
	processor_set_t pset,
	unsigned *ltotal, /* out */
	vm_size_t *space, /* out */
	vm_size_t *resident, /* out */
	vm_size_t *maxusage, /* out */
	vm_offset_t *maxstack /* out */
)
MIG routine from mach/processor_set.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/kern/stack.c
Debugging interface reporting kernel stack usage for the threads of a processor set; pset must be the default processor set or KERN_INVALID_ARGUMENT is returned. On DEVELOPMENT and DEBUG kernels, returns in ltotal the number of threads currently holding a kernel stack, and in space and resident that count times the (rounded) kernel stack size; maxusage and maxstack are always returned as zero. On RELEASE kernels the routine returns KERN_NOT_SUPPORTED.

functionprocessor_set_info

extern kern_return_t processor_set_info(
	processor_set_name_t set_name,
	int flavor,
	host_t *host, /* out */
	processor_set_info_t info_out, /* out */
	mach_msg_type_number_t *info_outCnt
)
Get information about processor set.
MIG routine from mach/processor_set.defs
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Return processor set state according to caller-specified flavor.
The processor_set_info function returns selected information for a processor set, as specified by flavor.
Notes. A processor set has a single default scheduling policy in effect for it (as returned by PROCESSOR_SET_BASIC_INFO), so only one of the default scheduling structures has valid information. On the other hand, a processor set maintains limits for all defined scheduling policies, so all of the scheduling limit structures return valid values.

functionprocessor_set_tasks_with_flavor

extern kern_return_t processor_set_tasks_with_flavor(
	processor_set_t processor_set,
	mach_task_flavor_t flavor,
	task_array_t *task_list, /* out */
	mach_msg_type_number_t *task_listCnt
)
List all tasks(/inspect/read) in processor set based on flavor.
MIG routine from mach/processor_set.defs