changeset 0d151793b2f3 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=0d151793b2f3
description:
        sim: fix issues with pwrite(); don't enable fstatfs

        this patch fixes issues with changeset 11593

        use the host's pwrite() syscall for pwrite64Func(),
        as opposed to pwrite64(), because pwrite64() does
        not work well on all distros.

        undo the enabling of fstatfs, as we will add this
        in a separate pate.

diffstat:

 src/arch/x86/linux/process.cc |  2 +-
 src/sim/syscall_emul.hh       |  3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r ba45735a726a -r 0d151793b2f3 src/arch/x86/linux/process.cc
--- a/src/arch/x86/linux/process.cc     Thu Aug 04 12:32:21 2016 -0400
+++ b/src/arch/x86/linux/process.cc     Fri Aug 05 17:15:19 2016 -0400
@@ -356,7 +356,7 @@
     /* 135 */ SyscallDesc("personality", unimplementedFunc),
     /* 136 */ SyscallDesc("ustat", unimplementedFunc),
     /* 137 */ SyscallDesc("statfs", unimplementedFunc),
-    /* 138 */ SyscallDesc("fstatfs", fstatfsFunc<X86Linux64>),
+    /* 138 */ SyscallDesc("fstatfs", unimplementedFunc),
     /* 139 */ SyscallDesc("sysfs", unimplementedFunc),
     /* 140 */ SyscallDesc("getpriority", unimplementedFunc),
     /* 141 */ SyscallDesc("setpriority", unimplementedFunc),
diff -r ba45735a726a -r 0d151793b2f3 src/sim/syscall_emul.hh
--- a/src/sim/syscall_emul.hh   Thu Aug 04 12:32:21 2016 -0400
+++ b/src/sim/syscall_emul.hh   Fri Aug 05 17:15:19 2016 -0400
@@ -64,6 +64,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/uio.h>
+#include <unistd.h>
 
 #include <cerrno>
 #include <string>
@@ -1406,7 +1407,7 @@
     BufferArg bufArg(bufPtr, nbytes);
     bufArg.copyIn(tc->getMemProxy());
 
-    int bytes_written = pwrite64(sim_fd, bufArg.bufferPtr(), nbytes, offset);
+    int bytes_written = pwrite(sim_fd, bufArg.bufferPtr(), nbytes, offset);
 
     return (bytes_written == -1) ? -errno : bytes_written;
 }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to