SYS_GETLPAR_INFO sysconfig Operation

Purpose

Copies the system LPAR information into a user-allocated buffer.

Description

The SYS_GETLPAR_INFO sysconfig operation copies the system LPAR information into a user-allocated buffer.

The parmp parameter on the sysconfig subroutine points to a structure of type getlpar_info. Within the getlpar_info structure, the lpar_namelen field must be set by the user to the maximum length of the character buffer pointed to by lpar_name. On return, the lpar_namelen field will have its value replaced by the acual length of the lpar_name field. However, only the minimum of the actual length or the length provided by the user will be copied into the buffer pointed to by lpar_name. The lpar_namesz, lpar_num, and lpar_name fields will contain valid data on returning from the call only if the system is running as an LPAR as indicated by the value of the lpar_flags field being equal to LPAR_ENABLED.

If a value of 0 is specified for the lpar_namesz field, the partition name will not be copied out.

If the system is not an LPAR (namely it is running as an SMP system), but it is LPAR-capable, the LPAR_CAPABLE flag will be set on return.

The getlpar_info structure is defined below:
lpar_flags       unsigned short          LPAR_ENABLED: System is LPAR enabled.
                                         LPAR_CAPABLE: System is LPAR capable, but running in SMP mode.
lpar_namesz      unsigned short          Size of partition name. 
lpar_num         int                     Partition Number.
lpar_name        char *                  Partition Name.
Note: The parmlen parameter (which is the third parameter to the sysconfig system call) is ignored by the SYS_GETLPAR_INFO sysconfig operation.

Error Codes

The SYS_GETLPAR_INFO operation returns a value of -1 if an error occurs and the errno global variable is set to one of the following error codes:
Item Description
EFAULT The calling process does not have sufficient authority to access the data area described by the parmp and parmlen parameters provided on the subroutine or the lpar_name field in the getlpar_info structure. This error is also returned if an I/O error occurred when accessing data in any of these areas.
EINVAL Invalid command parameter to the sysconfig subroutine.

Files

Item Description
sys/sysconfig.h Contains structure definitions and flags.