---
name: "apm"
section: "4"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["linux", "freebsd", "openbsd"]
url: "https://new.carta.tech/apm/4"
---

# apm(4)

power management interface

## NAME

**apm** – power management interface

## SYNOPSIS

**acpi0 at mainbus?**

## DESCRIPTION

The **apm** driver provides a user interface to the [acpi(4)](/acpi/4.md) driver.

The **apm** driver implements the following [ioctl(2)](/ioctl/2.md) calls. They are defined in ⟨machine/apmvar.h⟩.

- APM\_IOC\_REJECT

  *Not* *implemented*. *DO* *NOT* *USE*.

- APM\_IOC\_STANDBY

  (no parameters) Request “standby” mode.

- APM\_IOC\_SUSPEND

  (no parameters) Request “suspend” mode.

- APM\_IOC\_HIBERNATE

  (no parameters) Request “hibernate” mode.

- APM\_IOC\_GETPOWER

  (struct apm\_power\_info) Request the current power state. The argument structure is as follows:

  ```
  struct apm_power_info {
  	u_char battery_state;
  	u_char ac_state;
  	u_char battery_life;
  	u_char spare1;
  	u_int minutes_left;
  	u_int spare2[6];
  };
  ```

  The following values are defined for *battery\_state*:

  - APM\_BATT\_HIGH

    Battery has a high state of charge.

  - APM\_BATT\_LOW

    Battery has a low state of charge.

  - APM\_BATT\_CRITICAL

    Battery has a critical state of charge.

  - APM\_BATT\_CHARGING

    Battery is not high, low, or critical and is currently charging.

  - APM\_BATT\_UNKNOWN

    Cannot read the current battery state.

  - APM\_BATTERY\_ABSENT

    No battery installed.

    The following values are defined for *ac\_state*:

    - APM\_AC\_OFF

      External power not detected.

    - APM\_AC\_ON

      External power detected.

    - APM\_AC\_BACKUP

      Backup power in use.

    - APM\_AC\_UNKNOWN

      External power state unknown.

      The *battery\_life* value contains the estimated percentage of battery life available. 100% indicates a full charge.

      The *minutes\_left* value contains the estimated number of minutes of battery life remaining.

- APM\_IOC\_DEV\_CTL

  (struct apm\_ctl) Allows an application to directly set the APM operating mode. The argument structure is as follows:

  ```
  struct apm_ctl {
  	u_int dev;
  	u_int mode;
  };
  ```

  *dev* indicates the device, typically APM\_DEV\_ALLDEVS.

  *mode* indicates the desired operating mode. Possible values are

  - APM\_SYS\_READY

    - APM\_SYS\_STANDBY

    - APM\_SYS\_SUSPEND

    - APM\_SYS\_OFF

    - APM\_LASTREQ\_INPROG

    - APM\_LASTREQ\_REJECTED

    - APM\_IOC\_PRN\_CTL

  (int) This [ioctl(2)](/ioctl/2.md) controls message output by the APM driver when a power change event is detected. The integer parameter is one of:

  - APM\_PRINT\_ON

    All power change events result in a message. This is the normal operating mode for the driver.

  - APM\_PRINT\_OFF

    Power change event messages are suppressed.

  - APM\_PRINT\_PCT

    Power change event messages are suppressed unless the estimated battery life percentage changes.

## FILES

- /dev/apm

  Power management data device. May only be opened read-only. May be opened by multiple concurrent users.

- /dev/apmctl

  Power management control device. May be opened read-write or write-only. May only be opened by one user at a time. An attempt to open the file when in use will fail, returning EBUSY.

## SEE ALSO

[acpi(4)](/acpi/4.md), [intro(4)](/intro/4.md), [halt(8)](/halt/8.md)
