From 93d8e6b898a70a3f6dba9da385d5933683bf325f Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Fri, 20 Jan 2017 14:12:58 -0500 Subject: syscall_emul: #ifdef new system calls to allow builds on OSX and BSD --- src/sim/syscall_emul.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/sim/syscall_emul.hh') diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 3e7221c0b..4433b5039 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -49,6 +49,12 @@ defined(__FreeBSD__) || defined(__CYGWIN__) || \ defined(__NetBSD__)) +#define NO_STATFS (defined(__APPLE__) || defined(__OpenBSD__) || \ + defined(__FreeBSD__) || defined(__NetBSD__)) + +#define NO_FALLOCATE (defined(__APPLE__) || defined(__OpenBSD__) || \ + defined(__FreeBSD__) || defined(__NetBSD__)) + /// /// @file syscall_emul.hh /// @@ -62,7 +68,9 @@ #include #include #include +#if (NO_STATFS == 0) #include +#endif #include #include #include @@ -1123,6 +1131,9 @@ SyscallReturn statfsFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { +#if NO_STATFS + warn("Host OS cannot support calls to statfs. Ignoring syscall"); +#else std::string path; int index = 0; @@ -1142,7 +1153,7 @@ statfsFunc(SyscallDesc *desc, int callnum, LiveProcess *process, return -errno; copyOutStatfsBuf(tc->getMemProxy(), bufPtr, &hostBuf); - +#endif return 0; } -- cgit v1.2.3