[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

pm_notify()

Receive notification when the status pf a power managed object changes

Synopsis:

#include <sys/pm.h>

int pm_notify(pm_hdl_t hdl, 
              unsigned flags, 
              const struct sigevent *event);

Arguments:

hdl
Handle to the power managed object obtained by pm_attach().
flags
Specify the changes of interest.
event
Pointer to a sigevent structure delivered when the requested change occurs, or NULL to cancel notifications

Library:

libpm

Description:

The pm_notify() receives notification when the status of a power managed object changes.

flags specifies the changes of interest:

PM_CHANGE_START
Receive notification at the start of a power mode change.
PM_CHANGE_DONE
Receive notification on completion of a power mode change.
PM_DRIVER_ATTACH
Receive notification when a driver registers to manage the power managed object.
PM_DRIVER_DETACH
Receive notification when the driver managing the object detaches (both normal and abnormal termination of the driver).

When one of the requested changes occurs, the specified event will be delivered.

The requested notification remains in effect until it explicitly canceled. This cancellation occurs if:

A call to pm_notify() replaces any notification set by a previous call and enable only the set of notifications specified by the new call.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EBADF
hdl is not a valid handle.
EINVAL
flags contains an invalid combination of flags.
EFAULT
A fault occurred accessing event.
ENOMEM
Insufficient memory for allocating power manager data structures.

Classification:

Neutrino

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pm_attach(), pm_detach()


[Previous] [Contents] [Next]