sim: fix issues with pwrite(); don't enable fstatfs
authorTony Gutierrez <anthony.gutierrez@amd.com>
Fri, 5 Aug 2016 21:15:19 +0000 (17:15 -0400)
committerTony Gutierrez <anthony.gutierrez@amd.com>
Fri, 5 Aug 2016 21:15:19 +0000 (17:15 -0400)
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.

src/arch/x86/linux/process.cc
src/sim/syscall_emul.hh

index 08137b94380d1b9f5bad29c0534100403d4da1ba..f68f1c4c86ec6e630abcb4eaa3b7c91c09dc6b0b 100644 (file)
@@ -356,7 +356,7 @@ static SyscallDesc syscallDescs64[] = {
     /* 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),
index 906a01edbb8df6de1f869cd67051b05bee3550b0..7cce9e9c05bc0b67066809c90eebb01f8b5a65c6 100644 (file)
@@ -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 @@ pwrite64Func(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
     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;
 }