Home | History | Annotate | Download | only in apmd

Lines Matching defs:ctl_fd

71 static enum apm_state handle_client(int sock_fd, int ctl_fd);
72 static void suspend(int ctl_fd);
73 static void stand_by(int ctl_fd);
74 static void resume(int ctl_fd);
179 handle_client(int sock_fd, int ctl_fd)
203 power_status(ctl_fd, 0, &reply.batterystate);
267 suspend(int ctl_fd)
275 ioctl(ctl_fd, APM_IOC_SUSPEND, 0);
279 stand_by(int ctl_fd)
287 ioctl(ctl_fd, APM_IOC_STANDBY, 0);
293 resume(int ctl_fd)
302 int ctl_fd, sock_fd, ch, ready;
398 if ((ctl_fd = open(fname, O_RDWR)) == -1) {
404 power_status(ctl_fd, 1, 0);
408 power_status(ctl_fd, 1, &pinfo);
421 set[0].fd = ctl_fd;
435 status = power_status(ctl_fd, 0, 0);
443 suspend(ctl_fd);
448 while (ioctl(ctl_fd, APM_IOC_NEXTEVENT, &apmevent) == 0) {
479 power_status(ctl_fd, 0, &pinfo);
492 (power_status(ctl_fd, 0, 0) & POWER_STATUS_ACON)) {
496 suspend(ctl_fd);
498 stand_by(ctl_fd);
500 resume(ctl_fd);
509 switch (handle_client(sock_fd, ctl_fd)) {
513 suspend(ctl_fd);
516 stand_by(ctl_fd);