From: Aleksandar Rikalo <address@hidden>
Implement support for translation of system call statx(). The
implementation includes invoking other (more mature) syscalls
(from the same 'stat' family) on the host side. This way,
problems of availability of statx() on the host side are
avoided.
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Stefan Markovic <address@hidden>
---
linux-user/syscall.c | 121 +++++++++++++++++++++++++++++++++++++++++++++-
linux-user/syscall_defs.h | 38 +++++++++++++++
2 files changed, 158 insertions(+), 1 deletion(-)
+ if ((p == NULL) || (*((char *)p) == 0)) {
+ /* By file descriptor */
+ ret = get_errno(fstat(dirfd, &st));
+ unlock_user(p, arg2, 0);
+ } else if (*((char *)p) == '/') {
+ /* Absolute pathname */
+ ret = get_errno(stat(path(p), &st));
+ unlock_user(p, arg2, 0);
+ } else {
+ if (dirfd == AT_FDCWD) {
+ /* Pathname relative to the current working directory */
+ ret = get_errno(stat(path(p), &st));
+ unlock_user(p, arg2, 0);
+ } else {
+ /*
+ * Pathname relative to the directory referred to by the
+ * file descriptor dirfd
+ */
+ ret = get_errno(fstatat(dirfd, path(p), &st, flags));
+ unlock_user(p, arg2, 0);
+ }
+ }