summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@arm.com>2009-11-14 11:49:01 -0600
committerAli Saidi <Ali.Saidi@arm.com>2009-11-14 11:49:01 -0600
commit4e9ce1805e3bbc6a6085502e94e0298eada77113 (patch)
treedc0c094220e16701dec1df1c647362a25bca744f /src/sim
parent48bc573f5f9709480da458e3c4627f7b7afd38f4 (diff)
downloadgem5-4e9ce1805e3bbc6a6085502e94e0298eada77113.tar.xz
SE: Fix SE mode OS X compilation.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/syscall_emul.cc12
-rw-r--r--src/sim/syscall_emul.hh2
2 files changed, 11 insertions, 3 deletions
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 4461e8b52..4726decc5 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -461,12 +461,16 @@ truncate64Func(SyscallDesc *desc, int num,
if (!tc->getMemPort()->tryReadString(path, process->getSyscallArg(tc, index)))
return -EFAULT;
- loff_t length = process->getSyscallArg(tc, index, 64);
+ int64_t length = process->getSyscallArg(tc, index, 64);
// Adjust path for current working directory
path = process->fullPath(path);
+#if NO_STAT64
+ int result = truncate(path.c_str(), length);
+#else
int result = truncate64(path.c_str(), length);
+#endif
return (result == -1) ? -errno : result;
}
@@ -480,9 +484,13 @@ ftruncate64Func(SyscallDesc *desc, int num,
if (fd < 0)
return -EBADF;
- loff_t length = process->getSyscallArg(tc, index, 64);
+ int64_t length = process->getSyscallArg(tc, index, 64);
+#if NO_STAT64
+ int result = ftruncate(fd, length);
+#else
int result = ftruncate64(fd, length);
+#endif
return (result == -1) ? -errno : result;
}
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 27c26afb0..66e800183 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1187,7 +1187,7 @@ timesFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
TypedBufferArg<typename OS::tms> bufp(process->getSyscallArg(tc, index));
// Fill in the time structure (in clocks)
- int64_t clocks = curTick * OS::_SC_CLK_TCK / Clock::Int::s;
+ int64_t clocks = curTick * OS::M5_SC_CLK_TCK / Clock::Int::s;
bufp->tms_utime = clocks;
bufp->tms_stime = 0;
bufp->tms_cutime = 0;