FreeBSD/usr.sbin/powerd/powerd.c
/*
 * Try to use ACPI to find the AC line status.  If this fails, fall back
 * to APM.  If nothing succeeds, we'll just run in default mode.
 */
Try to use ACPI to find the AC line status.  If this fails, fall back
to APM.  If nothing succeeds, we'll just run in default mode.
Try to use ACPI to find the AC line status . If this fails fall back to APM . If nothing succeeds we ' ll just run in default mode .
static void
acline_init(void)
{
	acline_mib_len = 4;
	acline_status = SRC_UNKNOWN;
	if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) {
		acline_mode = ac_sysctl;
		if (vflag)
			warnx("using sysctl for AC line status");
#if __powerpc__
	} else if (sysctlnametomib(PMUAC, acline_mib, &acline_mib_len) == 0) {
		acline_mode = ac_sysctl;
		if (vflag)
			warnx("using sysctl for AC line status");
#endif
#ifdef USE_APM
	} else if ((apm_fd = open(APMDEV, O_RDONLY)) >= 0) {
		if (vflag)
			warnx("using APM for AC line status");
		acline_mode = ac_apm;
#endif
	} else {
		warnx("unable to determine AC line status");
		acline_mode = ac_none;
	}
}
static void acline_init ( void ) { acline_mib_len = 4 ; acline_status = SRC_UNKNOWN ; if ( sysctlnametomib ( ACPIAC , acline_mib , & acline_mib_len ) == 0 ) { acline_mode = ac_sysctl ; if ( vflag ) warnx ( " " ) ; #if __powerpc__ } else if ( sysctlnametomib ( PMUAC , acline_mib , & acline_mib_len ) == 0 ) { acline_mode = ac_sysctl ; if ( vflag ) warnx ( " " ) ; #endif #ifdef USE_APM } else if ( ( apm_fd = open ( APMDEV , O_RDONLY ) ) >= 0 ) { if ( vflag ) warnx ( " " ) ; acline_mode = ac_apm ; #endif 
	} else { warnx ( " " ) ; acline_mode = ac_none ; } }
Try to use ACPI to find the AC line status.
Try to use ACPI to find the AC line status .