p_online(2) — SYSTEM CALLS
NAME
p_online − turn a processor online or offline
SYNOPSIS
#include <sys/types.h>
#include <sys/processor.h> p_online (processorid_t processorid, int flag);
DESCRIPTION
p_online brings a processor online or takes it offline. When a processor is online, it is performing normal operations, scheduling and executing processes, and servicing any I/O devices to which it has access.
If flag is P_ONLINE, the named processor is brought online. If the processor was already online, nothing is done. The previous state of the processor (P_ONLINE or P_OFFLINE) is returned.
If flag is P_OFFLINE, the named processor is shut down and taken offline. If the processor was already offline, nothing is done. The previous state of the processor is returned. An attempt to take a processor offline may fail for several reasons:
One or more processes are bound to the processor.
The processor is the only online processor.
The processor performs some essential system function which cannot be taken over by another processor.
Multiprocessor locking is disabled either because it was forced off at boot time or configured out at kernel build time. The kernel must be rebooted for multiprocessor operation to be restored.
The processor is the only online processor that doesn’t have a process-set bound to it (for example, by pexbind).
The processor has internal kernel timeouts scheduled to run on it in the future.
The calling process must have superuser privileges to bring a processor online or take it offline.
DIAGNOSTICS
p_online returns P_ONLINE or P_OFFLINE on success, or −1 on failure. Failure may result from:
EPERM The calling process does not have appropriate privileges.
EINVAL The processorid does not refer to an existing processor, or the flag has an invalid value.
EACCES
Multiprocessor locking is disabled.
EBUSY The processorid for P_OFFLINE cannot be taken offline because it performs some essential system function, or the processorid refers to a processor with processes bound to it, or the processorid is the only online processor that doesn’t have a process-set bound to it, or the processorid has kernel timeouts scheduled on it.
EIO The processor to which processorid refers is non-operational.
SEE ALSO
offline(1M), online(1M), pinfo(1M), boot(1M), buildsys(1M), mkboot(1M)
— Multiprocessing