/dev/pow
and
/dev/pow1
are devices used to access the x68k power switch / bootstrap information and
the RTC alarm timer. The following operations are allowed using
ioctl(2)
system call:
ioctl (fd, POWIOCGPOWERINFO, &powerinfo);
struct x68k_powerinfo powerinfo;
Returns the power switch status etc. in the following structure.
struct x68k_powerinfo {
int pow_switch_boottime;
int pow_switch_current;
time_t pow_boottime;
unsigned int pow_bootcount;
time_t pow_usedtotal;
};
Each member means:
EXPWON-related information is not tested.
ioctl (fd, POWIOCGALARMINFO, &alarminfo);
struct x68k_alarminfo alarminfo;
Returns x68k's alarm timer information in the following structure.
struct x68k_alarminfo {
int al_enable;
unsigned int al_ontime;
int al_dowhat;
time_t al_offtime;
};
Each of the members means:
ioctl (fd, POWIOCSALARMINFO, &alarminfo);
struct x68k_alarminfo alarminfo;
Sets the alarm timer according to the argument alarminfo (see above).
ioctl (fd, POWIOCSSIGNAL, &signum);
int signum;
Signal
signum
is sent when the state of the power switch
(front or external) changes. It becomes invalid when
close(2)
is called.
Note that this function is not provided with
/dev/pow1
.
/dev/pow
can only be opened by one process at a time.