aboutsummaryrefslogtreecommitdiffstats
path: root/cutils.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-11 21:35:42 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-11 21:35:42 +0000
commitca10f86763f58b7b3667e2ca7d26db3dc810eb20 (patch)
treedf0e6a1b430a4e0c68e7d11d83c1f974afe3c412 /cutils.c
parentea86e4e6007af70a5e23c4f93eea9d0732e3bcb0 (diff)
Remove osdep.c/qemu-img code duplication
(Kevin Wolf) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4191 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cutils.c')
-rw-r--r--cutils.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/cutils.c b/cutils.c
index 9ef2fa627..738d5265d 100644
--- a/cutils.c
+++ b/cutils.c
@@ -95,3 +95,38 @@ time_t mktimegm(struct tm *tm)
t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec;
return t;
}
+
+void *get_mmap_addr(unsigned long size)
+{
+ return NULL;
+}
+
+void qemu_free(void *ptr)
+{
+ free(ptr);
+}
+
+void *qemu_malloc(size_t size)
+{
+ return malloc(size);
+}
+
+void *qemu_mallocz(size_t size)
+{
+ void *ptr;
+ ptr = qemu_malloc(size);
+ if (!ptr)
+ return NULL;
+ memset(ptr, 0, size);
+ return ptr;
+}
+
+char *qemu_strdup(const char *str)
+{
+ char *ptr;
+ ptr = qemu_malloc(strlen(str) + 1);
+ if (!ptr)
+ return NULL;
+ strcpy(ptr, str);
+ return ptr;
+}