[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] linux-user: Linux kernel's fchmodat has three args
From: |
takasi-y |
Subject: |
[Qemu-devel] [PATCH] linux-user: Linux kernel's fchmodat has three args (no 4th arg) |
Date: |
Sun, 19 Apr 2009 02:47:44 +0900 (JST) |
In Linux kernel, fchmodat() takes tree args.
4th value <int flags> is only processed by libc. It can be passed as 0 to
host libc, because it has been processed on target side.
Signed-off-by: Takashi YOSHII <address@hidden>
---
In Linux kernel, this has three args at least between 2.6.16 ...
current(2.6.29+)
In QEMU, this has been implemented as four args from the first.
But has not results error until #7118 was introduced.
Tested on x86_64 host(Debian 5.0.1) + sh4a target(GentooLinux glibc2.8)
/yoshii
---
linux-user/syscall.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ffdbb98..2fc6817 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -309,9 +309,9 @@ static int sys_faccessat(int dirfd, const char *pathname,
int mode, int flags)
}
#endif
#ifdef TARGET_NR_fchmodat
-static int sys_fchmodat(int dirfd, const char *pathname, mode_t mode, int
flags)
+static int sys_fchmodat(int dirfd, const char *pathname, mode_t mode)
{
- return (fchmodat(dirfd, pathname, mode, flags));
+ return (fchmodat(dirfd, pathname, mode, 0));
}
#endif
#if defined(TARGET_NR_fchownat) && defined(USE_UID16)
@@ -428,8 +428,7 @@ static int sys_utimensat(int dirfd, const char *pathname,
_syscall4(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode,int,flags)
#endif
#if defined(TARGET_NR_fchmodat) && defined(__NR_fchmodat)
-_syscall4(int,sys_fchmodat,int,dirfd,const char *,pathname,
- mode_t,mode,int,flags)
+_syscall3(int,sys_fchmodat,int,dirfd,const char *,pathname, mode_t,mode)
#endif
#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16)
_syscall5(int,sys_fchownat,int,dirfd,const char *,pathname,
@@ -4944,7 +4943,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_fchmodat:
if (!(p = lock_user_string(arg2)))
goto efault;
- ret = get_errno(sys_fchmodat(arg1, p, arg3, arg4));
+ ret = get_errno(sys_fchmodat(arg1, p, arg3));
unlock_user(p, arg2, 0);
break;
#endif
--
1.5.6.5
- [Qemu-devel] [PATCH] linux-user: Linux kernel's fchmodat has three args (no 4th arg),
takasi-y <=