Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/51547 )
Change subject: sim-se: Define rmdirImpl helper
......................................................................
sim-se: Define rmdirImpl helper
This will be used by the following commit when properly reimplementing
unlinkat syscall
Signed-off-by: Giacomo Travaglini <[email protected]>
Change-Id: If207bed196ad467decaa1cfee70a538e6dfe8d1d
---
M src/sim/syscall_emul.cc
M src/sim/syscall_emul.hh
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 35f047d..acf5dcd 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -963,11 +963,17 @@
SyscallReturn
rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
{
- auto p = tc->getProcessPtr();
std::string path;
if (!SETranslatingPortProxy(tc).tryReadString(path, pathname))
return -EFAULT;
+ return rmdirImpl(desc, tc, path);
+}
+
+SyscallReturn
+rmdirImpl(SyscallDesc *desc, ThreadContext *tc, std::string path)
+{
+ auto p = tc->getProcessPtr();
path = p->checkPathRedirect(path);
auto result = rmdir(path.c_str());
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index be30797..77cdf58 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -206,7 +206,10 @@
SyscallReturn chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<>
pathname);
// Target rmdir() handler.
-SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<>
pathname);
+SyscallReturn rmdirFunc(SyscallDesc *desc, ThreadContext *tc,
+ VPtr<> pathname);
+SyscallReturn rmdirImpl(SyscallDesc *desc, ThreadContext *tc,
+ std::string path);
/// Target rename() handler.
SyscallReturn renameFunc(SyscallDesc *desc, ThreadContext *tc,
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51547
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If207bed196ad467decaa1cfee70a538e6dfe8d1d
Gerrit-Change-Number: 51547
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s