PM (Power Management) Library (libpm.a)
#include <pmlib.h>
int pmlib_request_state (ctrl, pms); int ctrl; pmlib_state_t *pms;
When ctrl is PMLIB_REQUEST_STATE, set one of the following state values to pms.state:
PMLIB_SYSTEM_FULL_ON | Full on |
PMLIB_SYSTEM_ENABLE | PM enable |
PMLIB_SYSTEM_STANDBY | Standby |
PMLIB_SYSTEM_SUSPEND | Suspend |
PMLIB_SYSTEM_HIBERNATION | Hibernation |
PMLIB_SYSTEM_SHUTDOWN | Shutdown |
When ctrl is PMLIB_QUERY_STATE, one of state values described at PMLIB_REQUEST_STATE is set to pms.state when the function returns. PM aware DD's name is also returned if it rejects the PM command.
When ctrl is PMLIB_QUERY_ERROR, one of the following error values are set to pms.error:
If an application caused system state change failure, the process id of that application is set to pms.pid, and the name set to pms.name when the function returns.
When ctrl is PMLIB_CONFIRM, set one of the following state values to pms.state.
PMLIB_SYSTEM_CHANGE_OK | OK to change the system state. |
PMLIB_SYSTEM_CHANGE_NO | No change to the system state. |
The pmlib_request_state subroutine is called to request to change PM system state, request to query PM system state, request to query the error of PM system state change, or request to confirm PM system state change. Non-root user can request to change state only if the specified action an the action within the range allowed to any user.
Upon successful completion, PMLIB_SUCCESS is returned. If the pmlib_request_state subroutine fails, PMLIB_ERROR is returned and the errno variable is set to an error code.
ESRCH | PM daemon is not running. |
EINVAL | Invalid argument. |
EPERM | Missing privilege. |
EBUSY | State change processing has already been started. |
The pmlib_request_state subroutine is part of the Base Operation System (BOS) Runtime.
The pmlib_get_event_notice subroutine, pmlib_request_battery subroutine, pmlib_request_parameter subroutine, pmlib_register_application subroutine.