memstat_uma.c (225330) | memstat_uma.c (242152) |
---|---|
1/*- 2 * Copyright (c) 2005-2006 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2005-2006 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/lib/libmemstat/memstat_uma.c 225330 2011-09-02 14:10:42Z pluknet $ | 26 * $FreeBSD: head/lib/libmemstat/memstat_uma.c 242152 2012-10-26 17:51:05Z mdf $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/cpuset.h> 31#include <sys/sysctl.h> 32 33#include <vm/vm.h> 34#include <vm/vm_page.h> --- 214 unchanged lines hidden (view full) --- 249 if (ret < 0) 250 return (MEMSTAT_ERROR_KVM); 251 if ((size_t)ret != size) 252 return (MEMSTAT_ERROR_KVM_SHORTREAD); 253 return (0); 254} 255 256static int | 27 */ 28 29#include <sys/param.h> 30#include <sys/cpuset.h> 31#include <sys/sysctl.h> 32 33#include <vm/vm.h> 34#include <vm/vm_page.h> --- 214 unchanged lines hidden (view full) --- 249 if (ret < 0) 250 return (MEMSTAT_ERROR_KVM); 251 if ((size_t)ret != size) 252 return (MEMSTAT_ERROR_KVM_SHORTREAD); 253 return (0); 254} 255 256static int |
257kread_string(kvm_t *kvm, void *kvm_pointer, char *buffer, int buflen) | 257kread_string(kvm_t *kvm, const void *kvm_pointer, char *buffer, int buflen) |
258{ 259 ssize_t ret; 260 int i; 261 262 for (i = 0; i < buflen; i++) { 263 ret = kvm_read(kvm, (unsigned long)kvm_pointer + i, 264 &(buffer[i]), sizeof(char)); 265 if (ret < 0) --- 199 unchanged lines hidden --- | 258{ 259 ssize_t ret; 260 int i; 261 262 for (i = 0; i < buflen; i++) { 263 ret = kvm_read(kvm, (unsigned long)kvm_pointer + i, 264 &(buffer[i]), sizeof(char)); 265 if (ret < 0) --- 199 unchanged lines hidden --- |