sim-se: Define rmdirImpl helper
This will be used by the following commit when properly reimplementing unlinkat syscall Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Change-Id: If207bed196ad467decaa1cfee70a538e6dfe8d1d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51547 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -963,11 +963,17 @@ chdirFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname)
|
||||
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());
|
||||
|
||||
@@ -206,7 +206,10 @@ SyscallReturn mknodFunc(SyscallDesc *desc, ThreadContext *tc,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user