TMP_CTL(2)

NAME
tmp_ctl - multi-processor control

SYNOPSIS
#include <sys/tmp_ctl.h>

ret = tmp_ctl(command, processor);
int ret, command, processor;

DESCRIPTION
Tmp_ctl allows processes to query the status of the processor pool resource. Superuser processes can also change the configuration. The defined commands (from tmp_ctl.h) have the following meanings:

TMP_NENG
    returns the number of processors configured in the processor pool. The processors may be online or offline. However, deconfigured processors will not be included. The processor argument is ignored.

TMP_OFFLINE
    shuts down a processor. The processor stops dispatching processes and is paused. Only the superuser is allowed to offline a processor.

TMP_ONLINE
    starts up a processor. The processor initializes and begins scheduling user processes. Only the superuser is allowed to online a processor.

TMP_QUERY
    returns the state (TMP_ENG_ONLINE or TMP_ENG_OFFLINE) of the selected processor.

RETURN VALUE
The call returns -1 on error (as well as setting errno). The call returns 0 on successful completion, or the desired information in the case of the query operations.

ERRORS
The tmp_ctl will fail if:

[EPERM]
    Process does not have superuser capability and an attempt to change the processor pool configuration was attempted.

[ENXIO]
    processor is out of range.

[ENODEV]
    processor is bad.

[EINVAL]
    processor is already offline or online.

[EBUSY]
    Attempting to offline a processor that has bound drivers or bound processes, or attempting to offline the last processor.

SEE ALSO
tmp_affinity(2), online(8).