Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/51059 )
Change subject: sim-se: Implement futimesat syscall
......................................................................
sim-se: Implement futimesat syscall
Change-Id: I0cfb577b77663f8e4fac5c68633bdd69c4c8e2ea
Signed-off-by: Giacomo Travaglini <[email protected]>
---
M src/sim/syscall_emul.hh
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 325cde6..9126b32 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -2032,19 +2032,20 @@
return 0;
}
-
-/// Target utimes() handler.
+/// Target futimesat() handler.
template <class OS>
SyscallReturn
-utimesFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname,
- VPtr<typename OS::timeval [2]> tp)
+futimesatFunc(SyscallDesc *desc, ThreadContext *tc,
+ int dirfd, VPtr<> pathname, VPtr<typename OS::timeval [2]>
tp)
{
std::string path;
- auto process = tc->getProcessPtr();
-
if (!SETranslatingPortProxy(tc).tryReadString(path, pathname))
return -EFAULT;
+ if (auto result = atPath<OS>(tc, dirfd, path); !result.successful()) {
+ return result;
+ }
+
struct timeval hostTimeval[2];
for (int i = 0; i < 2; ++i) {
hostTimeval[i].tv_sec = gtoh((*tp)[i].tv_sec, OS::byteOrder);
@@ -2052,6 +2053,7 @@
}
// Adjust path for cwd and redirection
+ auto process = tc->getProcessPtr();
path = process->checkPathRedirect(path);
int result = utimes(path.c_str(), hostTimeval);
@@ -2062,6 +2064,15 @@
return 0;
}
+/// Target utimes() handler.
+template <class OS>
+SyscallReturn
+utimesFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> pathname,
+ VPtr<typename OS::timeval [2]> tp)
+{
+ return futimesatFunc<OS>(desc, tc, OS::TGT_AT_FDCWD, pathname, tp);
+}
+
template <class OS>
SyscallReturn
execveFunc(SyscallDesc *desc, ThreadContext *tc,
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51059
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: I0cfb577b77663f8e4fac5c68633bdd69c4c8e2ea
Gerrit-Change-Number: 51059
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