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.
This commit is contained in:
Tony Gutierrez 2016-08-05 17:15:19 -04:00
parent 0b68475b10
commit fa5e64987e
2 changed files with 3 additions and 2 deletions

View 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),

View 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;
}