powerhook_establish man page on MirBSD

Man page or keyword search:  
man Server   6113 pages
apropos Keyword Search (all sections)
Output format
MirBSD logo
[printable version]

POWERHOOK_ESTABLISH(9)	      BSD Kernel Manual		POWERHOOK_ESTABLISH(9)

NAME
     powerhook_establish, powerhook_disestablish - add or remove a power hook

SYNOPSIS
     #include <sys/types.h>
     #include <sys/systm.h>

     void *
     powerhook_establish(void (*fn)(int, void *), void *arg);

     void
     powerhook_disestablish(void *cookie);

DESCRIPTION
     The powerhook_establish() function adds fn to the list of hooks invoked
     by dopowerhooks(9) during any change in apm(4) power state (i.e., during
     a "suspend", "standby", or "resume"). When invoked, the hook function fn
     will be passed an int why and arg as its arguments. The int value why
     will be one of PWR_RESUME, PWR_SUSPEND, and PWR_STANDBY.

     The powerhook_disestablish() function removes the hook described by the
     opaque pointer cookie from the list of power hooks. If cookie is invalid,
     the result of powerhook_disestablish() is undefined.

RETURN VALUES
     If successful, powerhook_establish() returns an opaque pointer describing
     the newly established power hook. Otherwise, it returns NULL.

EXAMPLES
     It may be appropriate to use a power hook to disestablish interrupts and
     disable PCMCIA functions on PC Cards that are present when the system is
     put into suspend mode. The reverse should happen on resume.

     It may be appropriate to use a power hook to halt audio output in a sound
     driver at suspend-time. On resume, it may not be possible to recover au-
     dio output, but at least the device can be put into a known, working
     state.

SEE ALSO
     apm(4), dopowerhooks(9)

MirOS BSD #10-current		 July 1, 2000				     1
[top]

List of man pages available for MirBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net