powerd.c (193161) | powerd.c (201227) |
---|---|
1/*- 2 * Copyright (c) 2004 Colin Percival 3 * Copyright (c) 2005 Nate Lawson 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted providing that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Colin Percival 3 * Copyright (c) 2005 Nate Lawson 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted providing that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/usr.sbin/powerd/powerd.c 193161 2009-05-31 10:27:24Z nwhitehorn $"); | 29__FBSDID("$FreeBSD: head/usr.sbin/powerd/powerd.c 201227 2009-12-29 22:53:27Z ed $"); |
30 31#include <sys/param.h> 32#include <sys/ioctl.h> 33#include <sys/sysctl.h> 34#include <sys/resource.h> 35#include <sys/socket.h> 36#include <sys/time.h> 37#include <sys/un.h> --- 216 unchanged lines hidden (view full) --- 254 return (i - 1); 255} 256 257/* 258 * Try to use ACPI to find the AC line status. If this fails, fall back 259 * to APM. If nothing succeeds, we'll just run in default mode. 260 */ 261static void | 30 31#include <sys/param.h> 32#include <sys/ioctl.h> 33#include <sys/sysctl.h> 34#include <sys/resource.h> 35#include <sys/socket.h> 36#include <sys/time.h> 37#include <sys/un.h> --- 216 unchanged lines hidden (view full) --- 254 return (i - 1); 255} 256 257/* 258 * Try to use ACPI to find the AC line status. If this fails, fall back 259 * to APM. If nothing succeeds, we'll just run in default mode. 260 */ 261static void |
262acline_init() | 262acline_init(void) |
263{ 264 acline_mib_len = 4; 265 266 if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { 267 acline_mode = ac_sysctl; 268 if (vflag) 269 warnx("using sysctl for AC line status"); 270#if __powerpc__ --- 432 unchanged lines hidden --- | 263{ 264 acline_mib_len = 4; 265 266 if (sysctlnametomib(ACPIAC, acline_mib, &acline_mib_len) == 0) { 267 acline_mode = ac_sysctl; 268 if (vflag) 269 warnx("using sysctl for AC line status"); 270#if __powerpc__ --- 432 unchanged lines hidden --- |