]>
git.saurik.com Git - apple/libc.git/blob - darwin/kvm.c
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
34 kvm_getargv(void* kd
, const void* p
, int nchr
)
40 kvm_getenvv(void* kd
, const void* p
, int nchr
)
52 kvm_getloadavg(void* kd
, double loadagv
[], int nelem
)
58 kvm_getfiles(void* kd
, int op
, int arg
, int* cnt
)
65 kvm_getprocs(void* kd
, int op
, int arg
, int* cnt
)
72 kvm_nlist(void* kd
, void* nl
)
78 kvm_open(const char* execfile
, const char* corefile
, const char* swapfile
, int flags
, const char* errstr
)
80 fprintf(stderr
, "%s%s/dev/mem: No such file or directory", errstr
? errstr
: "", errstr
? ": " : "");
85 kvm_openfiles(const char* execfile
, const char* corefile
, const char* swapfile
, int flags
, char* errout
)
87 if (errout
) strcpy(errout
, "/dev/mem: No such file or directory");
92 kvm_read(void* kd
, unsigned long addr
, void* buf
, unsigned int nbytes
)
98 kvm_uread(void* kd
, void* p
, unsigned long uva
, void* buf
, size_t len
)
104 kvm_write(void* kd
, unsigned long addr
, const void* buf
, unsigned int nbytes
)