changeset 408673e38566 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=408673e38566
description:
SE: Fix SE mode OS X compilation.
diffstat:
3 files changed, 12 insertions(+), 4 deletions(-)
src/kern/linux/linux.hh | 2 +-
src/sim/syscall_emul.cc | 12 ++++++++++--
src/sim/syscall_emul.hh | 2 +-
diffs (60 lines):
diff -r f9e317156e45 -r 408673e38566 src/kern/linux/linux.hh
--- a/src/kern/linux/linux.hh Sat Nov 14 11:25:00 2009 -0600
+++ b/src/kern/linux/linux.hh Sat Nov 14 11:49:01 2009 -0600
@@ -138,7 +138,7 @@
};
/// Clock ticks per second, for times().
- static const int _SC_CLK_TCK = 100;
+ static const int M5_SC_CLK_TCK = 100;
/// For times().
struct tms {
diff -r f9e317156e45 -r 408673e38566 src/sim/syscall_emul.cc
--- a/src/sim/syscall_emul.cc Sat Nov 14 11:25:00 2009 -0600
+++ b/src/sim/syscall_emul.cc Sat Nov 14 11:49:01 2009 -0600
@@ -461,12 +461,16 @@
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 @@
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 -r f9e317156e45 -r 408673e38566 src/sim/syscall_emul.hh
--- a/src/sim/syscall_emul.hh Sat Nov 14 11:25:00 2009 -0600
+++ b/src/sim/syscall_emul.hh Sat Nov 14 11:49:01 2009 -0600
@@ -1187,7 +1187,7 @@
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;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev