aboutsummaryrefslogtreecommitdiff
path: root/osdep.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-17 23:31:19 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-17 23:31:19 +0000
commit605686cd7acdc37b87134c7eedf01b99db9213c1 (patch)
tree647a93faacb07d0c73745c6072080e59281d2218 /osdep.c
parent8182266352df123bbe5661d14ded4ef06d866a60 (diff)
downloadqemu-605686cd7acdc37b87134c7eedf01b99db9213c1.zip
qemu-605686cd7acdc37b87134c7eedf01b99db9213c1.tar.gz
qemu-605686cd7acdc37b87134c7eedf01b99db9213c1.tar.bz2
Kqemu support for Solaris, by Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2329 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'osdep.c')
-rw-r--r--osdep.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/osdep.c b/osdep.c
index 1a4c036..d1eff8d 100644
--- a/osdep.c
+++ b/osdep.c
@@ -27,6 +27,10 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
+#ifdef HOST_SOLARIS
+#include <sys/types.h>
+#include <sys/statvfs.h>
+#endif
#include "cpu.h"
#if defined(USE_KQEMU)
@@ -86,13 +90,22 @@ void *kqemu_vmalloc(size_t size)
const char *tmpdir;
char phys_ram_file[1024];
void *ptr;
+#ifdef HOST_SOLARIS
+ struct statvfs stfs;
+#else
struct statfs stfs;
+#endif
if (phys_ram_fd < 0) {
tmpdir = getenv("QEMU_TMPDIR");
if (!tmpdir)
+#ifdef HOST_SOLARIS
+ tmpdir = "/tmp";
+ if (statvfs(tmpdir, &stfs) == 0) {
+#else
tmpdir = "/dev/shm";
if (statfs(tmpdir, &stfs) == 0) {
+#endif
int64_t free_space;
int ram_mb;