SE: Fix SE mode OS X compilation.
authorAli Saidi <Ali.Saidi@arm.com>
Sat, 14 Nov 2009 17:49:01 +0000 (11:49 -0600)
committerAli Saidi <Ali.Saidi@arm.com>
Sat, 14 Nov 2009 17:49:01 +0000 (11:49 -0600)
src/kern/linux/linux.hh
src/sim/syscall_emul.cc
src/sim/syscall_emul.hh

index 736213762b4e8324bc378f5dc033ece2e2af98bf..7fe107139bdf7fda1baa51f0660e0d62565ae544 100644 (file)
@@ -138,7 +138,7 @@ class Linux : public OperatingSystem
     };
 
     /// 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 {
index 4461e8b528c8510f5d3e4a3a1023cb974c0351b5..4726decc5769aede1ed5d121691f85bbbc0e55b9 100644 (file)
@@ -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;
 }
 
index 27c26afb0f08714bf015cf33b0a54fdf2cddc3b0..66e8001836766ba2f942e6fedff6c3127517558c 100644 (file)
@@ -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;