]> git.saurik.com Git - apple/libc.git/blob - darwin/kvm.c
Libc-825.26.tar.gz
[apple/libc.git] / darwin / kvm.c
1 /*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #include <stdio.h>
25 #include <string.h>
26
27 int
28 kvm_close(void* kd)
29 {
30 return (0);
31 }
32
33 char**
34 kvm_getargv(void* kd, const void* p, int nchr)
35 {
36 return (0);
37 }
38
39 char**
40 kvm_getenvv(void* kd, const void* p, int nchr)
41 {
42 return (0);
43 }
44
45 char*
46 kvm_geterr(void* kd)
47 {
48 return (0);
49 }
50
51 int
52 kvm_getloadavg(void* kd, double loadagv[], int nelem)
53 {
54 return (-1);
55 }
56
57 char*
58 kvm_getfiles(void* kd, int op, int arg, int* cnt)
59 {
60 if (cnt) *cnt = 0;
61 return (0);
62 }
63
64 void*
65 kvm_getprocs(void* kd, int op, int arg, int* cnt)
66 {
67 if (cnt) *cnt = 0;
68 return (0);
69 }
70
71 int
72 kvm_nlist(void* kd, void* nl)
73 {
74 return (-1);
75 }
76
77 void*
78 kvm_open(const char* execfile, const char* corefile, const char* swapfile, int flags, const char* errstr)
79 {
80 fprintf(stderr, "%s%s/dev/mem: No such file or directory", errstr ? errstr : "", errstr ? ": " : "");
81 return (0);
82 }
83
84 void*
85 kvm_openfiles(const char* execfile, const char* corefile, const char* swapfile, int flags, char* errout)
86 {
87 if (errout) strcpy(errout, "/dev/mem: No such file or directory");
88 return (0);
89 }
90
91 int
92 kvm_read(void* kd, unsigned long addr, void* buf, unsigned int nbytes)
93 {
94 return (-1);
95 }
96
97 int
98 kvm_uread(void* kd, void* p, unsigned long uva, void* buf, size_t len)
99 {
100 return (0);
101 }
102
103 int
104 kvm_write(void* kd, unsigned long addr, const void* buf, unsigned int nbytes)
105 {
106 return (0);
107 }