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:
parent
0b68475b10
commit
fa5e64987e
2 changed files with 3 additions and 2 deletions
|
@ -356,7 +356,7 @@ static SyscallDesc syscallDescs64[] = {
|
||||||
/* 135 */ SyscallDesc("personality", unimplementedFunc),
|
/* 135 */ SyscallDesc("personality", unimplementedFunc),
|
||||||
/* 136 */ SyscallDesc("ustat", unimplementedFunc),
|
/* 136 */ SyscallDesc("ustat", unimplementedFunc),
|
||||||
/* 137 */ SyscallDesc("statfs", unimplementedFunc),
|
/* 137 */ SyscallDesc("statfs", unimplementedFunc),
|
||||||
/* 138 */ SyscallDesc("fstatfs", fstatfsFunc<X86Linux64>),
|
/* 138 */ SyscallDesc("fstatfs", unimplementedFunc),
|
||||||
/* 139 */ SyscallDesc("sysfs", unimplementedFunc),
|
/* 139 */ SyscallDesc("sysfs", unimplementedFunc),
|
||||||
/* 140 */ SyscallDesc("getpriority", unimplementedFunc),
|
/* 140 */ SyscallDesc("getpriority", unimplementedFunc),
|
||||||
/* 141 */ SyscallDesc("setpriority", unimplementedFunc),
|
/* 141 */ SyscallDesc("setpriority", unimplementedFunc),
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -1406,7 +1407,7 @@ pwrite64Func(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
|
||||||
BufferArg bufArg(bufPtr, nbytes);
|
BufferArg bufArg(bufPtr, nbytes);
|
||||||
bufArg.copyIn(tc->getMemProxy());
|
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;
|
return (bytes_written == -1) ? -errno : bytes_written;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue