The p_online() function changes or returns the operational status of processors. The state of the processor specified by the processorid argument is changed to the state represented by the flag argument.
Legal values for flag are P_STATUS, P_ONLINE, P_OFFLINE, and P_NOINTR.
When flag is P_STATUS, no processor status change occurs, but the current processor status is returned.
The P_ONLINE, P_OFFLINE, and P_NOINTR values for flag refer to valid processor states. A processor in the P_ONLINE state is allowed to process LWPs (lightweight processes) and perform system activities. The processor is also interruptible by I/O devices attached to the system.
A processor in the P_OFFLINE state is not allowed to process LWPs. The processor is as inactive as possible. If the hardware supports such a feature, the processor is not interruptible by attached I/O devices.
A processor in the P_NOINTR state is allowed to process LWPs, but it is not interruptible by attached I/O devices. Typically, interrupts, when they occur are routed to other processors in the system. Not all systems support
putting a processor into the P_NOINTR state. It is not permitted to put all the processors of a system into the P_NOINTR state. At least one processor must always be available to service system clock interrupts.
Processor numbers are integers, greater than or equal to 0, and are defined by the hardware platform. Processor numbers are not necessarily contiguous, but "not too sparse." Processor numbers should always be printed in decimal.
The maximum possible processorid value can be determined by calling sysconf(_SC_CPUID_MAX). The list of valid processor numbers can be determined by calling p_online() with processorid values from 0 to the maximum
returned by sysconf(_SC_CPUID_MAX). The EINVAL error is returned for invalid processor numbers. See EXAMPLES below.
|