mpconf(3c)
mpconf - multiprocessing control and information
As shipped in IRIX 6.5.19. Unchanged since IRIX 6.5.
NAME mpconf - multiprocessing control and information SYNOPSIS #include <sys/mpconf.h> #include <sys/sysinfo.h> int mpconf (int cmd, ...); DESCRIPTION mpconf provides control/information for miscellaneous multi-processor services. The arguments arg1, arg2, arg3 are provided for command- dependent use. As specified by cmd, the following commands are available: _MIPS_MP_NPROCESSORS Returns the number of processors physically configured. _MIPS_MP_NAPROCESSORS Returns the number of processors that are available to schedule unrestricted processes. _MIPS_MP_ISPROCESSOR_AVAIL The processor number given by arg1, interpreted as an 'int', is checked to see if it is available and not exclusively bound by any process and if this is true a value of one(1) is returned. If the processor is not available, a value of zero(0) is returned. _MIPS_MP_PROCESSOR_ACCT Returns the contents of abi_sysinfo structure. The information is only for the processor specified by arg1. arg2 points to a buffer which will contain the contents of the structure abi_sysinfo in the address space of the calling process and arg3 specifies the maximum number of bytes to transfer. If successful, the command returns the number of bytes transferred. _MIPS_MP_PROCESSOR_TOTACCT Returns the contents of the abi_sysinfo structure. The information is summed across all processors before it is returned. arg1 points to a buffer which will contain the contents of the structure abi_sysinfo and arg2 specifies the maximum number of bytes to transfer. If successful, the command returns the number of bytes transferred. _MIPS_MP_PROCESSOR_PID If the process number specified in arg1, interpreted as 'pid_t', is bound to a processor, then one(1) is returned and the integer pointer in arg2, interpreted as 'int *', is used to store the processor number to which the process is bound. There is no indication whether the binding in effect is exclusive or non- exclusive. The command returns zero(0) if the process is not bound. If arg1 contains an invalid process number, then a -1 is returned and errno is set to reflect the error. _MIPS_MP_PROCESSOR_BIND Bind a process number pointed to arg2, interpreted as 'pid_t *', to the processor number in arg1, interpreted as 'int'. The process is restricted to run only on this processor. The processor may continue to run other processes. Note that the process may still run on other processors, briefly, to perform I/O or other hardware- specific actions. If a previous binding was in effect for the process number pointed to by arg2, and the binding was not exclusive, then new binding replaces the previous one. If the previous binding was exclusive, the command fails. If a previous exclusive binding is in effect for this processor, it is unavailable to be reserved, and the command fails. The command returns a zero(0) when successful. _MIPS_MP_PROCESSOR_UNBIND Unbind a process number pointed to by arg1, interpreted as 'pid_t *', making it free to run on any processor. _MIPS_MP_PROCESSOR_UNBIND cannot unbind exclusively bound processes. _MIPS_MP_PROCESSOR_EXUNBIND should be used for this purpose. _MIPS_MP_PROCESSOR_EXBIND Exclusively bind a process number pointed to by arg2, interpreted as 'pid_t *', to the processor number specified by arg1, interpreted as 'int'. The process is restricted to run only on this processor. The processor may still run on other processors, briefly, to perform I/O or other hardware-specific actions. The specified processor is restricted to run only those processes that are either exclusively bound to it, or for which it must provide service due to hardware necessity, for as long as the exclusive binding is in effect. This command requires superuser authority. If a previous binding was in effect for pid, the new binding replaces the previous one. If a previous non-exclusive binding for a process other than the process number pointed to by arg2 is in effect for this processor, it is unavailable to be reserved, and the command fails. The command returns zero() when successful. Possible errors from mpconf are: [EPERM] The effective user ID is not superuser. Many of the commands require superuser privilege. [EPERM] The user ID of the sending process is not super-user, and its real or effective user ID does not match the real, saved, or effective user ID of the receiving process. [ESRCH] No process corresponding to that specified by a MP_MUSTRUN_PID, MP_GETMUSTRUN_PID, or MP_RUNANYWHERE_PID could be found. [EEXIST] An attempt was made to create a new processor set, but the set already exists in the system. [EINVAL] The processor set named by a MP_PSET command does not exist. [EINVAL] The bit vector given for the MPPS_CREATE subcommand of the MP_PSET command conflicts with a reserved value. [EBUSY] An attempt was made to delete a processor set, but the set is currently in use by the system. [EINVAL] The processor named by a MP_EMPOWER, MP_RESTRICT, MP_PSET, MP_CLOCK or MP_SAGET1 command does not exist. [EINVAL] The cmd argument is invalid. [EINVAL] The arg1 argument to a MP_KERNADDR command is invalid. [EINVAL] An attempt was made via MP_MUSTRUN or MP_MUSTRUN_PID to move a process owning a CC sync register from the cpu controlling the CC sync register. [EINVAL] The target of the MP_GETMUSTRUN command has not been set to run on a specific processor. [EBUSY] An attempt was made to restrict the only unrestricted processor or to restrict the master processor. [EFAULT] An invalid buffer address has been supplied by the calling process. [ENOMEM] Unable to obtain enough dynamic memory. SEE ALSO sysmp(2) DIAGNOSTICS Upon successful completion, the cmd dependent data is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.