summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2019-03-11 14:17:07 -0400
committerBrandon Potter <Brandon.Potter@amd.com>2019-08-01 19:53:22 +0000
commit9afe480c404543a0f7fe59b3abe5bd3d50367c5c (patch)
tree55dab1b5cdeb9d6cda918fa16bd96832f06eaf9c /src/sim
parent2b071a02e7e136cde1caf70f35a384f052b75cad (diff)
downloadgem5-9afe480c404543a0f7fe59b3abe5bd3d50367c5c.tar.xz
sim-se: fstat64 bugfix
The fstat64 system call does an upcast on entries in the file descriptor array to check if the file descriptor has a backing host-filesystem file opened. It does so because it needs to pass the host fd into the fstat call (since we rely on the host filesystem to service filesystem system calls). The upcast was overly specific. This changeset alters the system call to use the most general base class of the file descriptor entries that can satisfy the code. Change-Id: I10daf820257cea4d678ee6917e01e9cc9cd1cf5e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17110 Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Brandon Potter <Brandon.Potter@amd.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/syscall_emul.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 8a73cb2b7..e2f2fc200 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1338,7 +1338,7 @@ fstat64Func(SyscallDesc *desc, int callnum, ThreadContext *tc)
int tgt_fd = p->getSyscallArg(tc, index);
Addr bufPtr = p->getSyscallArg(tc, index);
- auto ffdp = std::dynamic_pointer_cast<FileFDEntry>((*p->fds)[tgt_fd]);
+ auto ffdp = std::dynamic_pointer_cast<HBFDEntry>((*p->fds)[tgt_fd]);
if (!ffdp)
return -EBADF;
int sim_fd = ffdp->getSimFD();