sysconf.c (214510) | sysconf.c (223136) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Sean Eric Fagan of Cygnus Support. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#if defined(LIBC_SCCS) && !defined(lint) 34static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94"; 35#endif /* LIBC_SCCS and not lint */ 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Sean Eric Fagan of Cygnus Support. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#if defined(LIBC_SCCS) && !defined(lint) 34static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94"; 35#endif /* LIBC_SCCS and not lint */ 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/lib/libc/gen/sysconf.c 214510 2010-10-29 13:31:10Z davidxu $"); | 37__FBSDID("$FreeBSD: head/lib/libc/gen/sysconf.c 223136 2011-06-16 02:22:24Z davidxu $"); |
38 39#include <sys/param.h> 40#include <sys/time.h> 41#include <sys/sysctl.h> 42#include <sys/resource.h> 43#include <sys/socket.h> 44 45#include <errno.h> --- 548 unchanged lines hidden (view full) --- 594 len = sizeof(lvalue); 595 if (sysctlbyname("hw.availpages", &lvalue, &len, NULL, 0) == -1) 596 return (-1); 597 return (lvalue); 598#endif 599 600#ifdef _SC_CPUSET_SIZE 601 case _SC_CPUSET_SIZE: | 38 39#include <sys/param.h> 40#include <sys/time.h> 41#include <sys/sysctl.h> 42#include <sys/resource.h> 43#include <sys/socket.h> 44 45#include <errno.h> --- 548 unchanged lines hidden (view full) --- 594 len = sizeof(lvalue); 595 if (sysctlbyname("hw.availpages", &lvalue, &len, NULL, 0) == -1) 596 return (-1); 597 return (lvalue); 598#endif 599 600#ifdef _SC_CPUSET_SIZE 601 case _SC_CPUSET_SIZE: |
602 len = sizeof(lvalue); 603 if (sysctlbyname("kern.sched.cpusetsize", &lvalue, &len, NULL, | 602 len = sizeof(value); 603 if (sysctlbyname("kern.sched.cpusetsize", &value, &len, NULL, |
604 0) == -1) 605 return (-1); | 604 0) == -1) 605 return (-1); |
606 return (lvalue); | 606 return ((long)value); |
607#endif 608 609 default: 610 errno = EINVAL; 611 return (-1); 612 } 613 len = sizeof(value); 614 if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) 615 value = -1; 616 return ((long)value); 617} | 607#endif 608 609 default: 610 errno = EINVAL; 611 return (-1); 612 } 613 len = sizeof(value); 614 if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) 615 value = -1; 616 return ((long)value); 617} |