diff options
author | roger <roger@FreeBSD.org> | 1999-08-26 11:11:48 +0000 |
---|---|---|
committer | roger <roger@FreeBSD.org> | 1999-08-26 11:11:48 +0000 |
commit | 74f029a93f7581ad50ec1131d07fc5cd6103421b (patch) | |
tree | 60257940634ddd3a42f4fefbae4faa684e038bc6 /release/picobsd | |
parent | ad6db0c2d632cfd247d10af9fddb2c33285aa43e (diff) | |
download | FreeBSD-src-74f029a93f7581ad50ec1131d07fc5cd6103421b.zip FreeBSD-src-74f029a93f7581ad50ec1131d07fc5cd6103421b.tar.gz |
Changed to get the page size using a sysctl rather than using DEFAULT_PAGE_SIZE
Suggested by: Alan Cox
Diffstat (limited to 'release/picobsd')
-rw-r--r-- | release/picobsd/tinyware/vm/vm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/release/picobsd/tinyware/vm/vm.c b/release/picobsd/tinyware/vm/vm.c index 8e089d8..f408f57 100644 --- a/release/picobsd/tinyware/vm/vm.c +++ b/release/picobsd/tinyware/vm/vm.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: vm.c,v 1.2 1998/10/29 12:38:06 abial Exp $ + * $Id: vm.c,v 1.4 1999/08/22 21:45:23 dwhite Exp $ */ #include <stdio.h> @@ -32,14 +32,18 @@ #include <sys/vmmeter.h> #include <vm/vm_param.h> -#define pgtok(a) ((a) * (u_int) DEFAULT_PAGE_SIZE >> 10) +#define pgtok(a) ((a) * (u_int) pagesize >> 10) int main(int argc, char *argv[]) { int mib[2],i=0,len; + int pagesize, pagesize_len; struct vmtotal v; + pagesize_len = sizeof(int); + sysctlbyname("vm.stats.vm.v_page_size",&pagesize,&pagesize_len,NULL,0); + len=sizeof(struct vmtotal); mib[0]=CTL_VM; mib[1]=VM_METER; |