aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-09-06 10:36:40 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-09-06 10:36:40 +0100
commiteaf1a8bc009757c3827d5aa3f4d41cf20dead444 (patch)
tree3bb8786f8788d1ffc7e744883372ef4386f659e6
parent551806d12fba3f98c633db439060e0398fd9a0b0 (diff)
linux-user: Use direct syscall for utimensat
The linux utimensat syscall differs in semantics from the libc function because the syscall combines the features of utimensat() and futimens(). Rather than trying to split these apart in order to call the two libc functions which then call the same underlying syscall, just always directly make the host syscall. This fixes bugs in some of the corner cases which should return errors from the syscall but which we were incorrectly directing to futimens(). This doesn't reduce the set of hosts that our syscall implementation will work on, because if the direct syscall fails ENOSYS then the libc functions would also fail ENOSYS. (The system call has been in the kernel since 2.6.22 anyway.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--linux-user/syscall.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index acb037a97b..ba9a55019a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -520,16 +520,7 @@ static int sys_getcwd1(char *buf, size_t size)
}
#ifdef TARGET_NR_utimensat
-#ifdef CONFIG_UTIMENSAT
-static int sys_utimensat(int dirfd, const char *pathname,
- const struct timespec times[2], int flags)
-{
- if (pathname == NULL)
- return futimens(dirfd, times);
- else
- return utimensat(dirfd, pathname, times, flags);
-}
-#elif defined(__NR_utimensat)
+#if defined(__NR_utimensat)
#define __NR_sys_utimensat __NR_utimensat
_syscall4(int,sys_utimensat,int,dirfd,const char *,pathname,
const struct timespec *,tsp,int,flags)