diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-04-08 14:04:12 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-04-08 14:04:12 +0000 |
commit | fec56ff05f7fef85e0b97dd7138a915437827cf4 (patch) | |
tree | 8753f7814dd5803f49ac80d42ad3c7fcf8fbceca /lib/libc/gen/sysconf.c | |
parent | 24074aa936a9adf215a17c2f71226991f566f692 (diff) |
Use VM_UVMEXP instead of VM_METER for memory usages and directly
include <sys/vmmeter.h> where it is needed instead of relying on
it being included by <uvm/uvm_extern.h>.
miod@ likes it, ok guenther@
Diffstat (limited to 'lib/libc/gen/sysconf.c')
-rw-r--r-- | lib/libc/gen/sysconf.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index f02faa5c01c..7e8d2ca6569 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysconf.c,v 1.18 2013/03/24 20:04:35 guenther Exp $ */ +/* $OpenBSD: sysconf.c,v 1.19 2014/04/08 14:04:11 mpi Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -36,9 +36,10 @@ #include <sys/sysctl.h> #include <sys/time.h> #include <sys/resource.h> -#include <sys/vmmeter.h> #include <sys/socket.h> +#include <uvm/uvm_extern.h> + #include <errno.h> #include <grp.h> #include <pthread.h> @@ -444,14 +445,14 @@ sysconf(int name) } case _SC_AVPHYS_PAGES: { - struct vmtotal vmtotal; + struct uvmexp uvmexp; mib[0] = CTL_VM; - mib[1] = VM_METER; - len = sizeof(vmtotal); - if (sysctl(mib, namelen, &vmtotal, &len, NULL, 0) == -1) + mib[1] = VM_UVMEXP; + len = sizeof(uvmexp); + if (sysctl(mib, namelen, &uvmexp, &len, NULL, 0) == -1) return (-1); - return (vmtotal.t_free); + return (uvmexp.free); } case _SC_NPROCESSORS_CONF: |