Commit 465c9f0630efbbca3e1279817d8bfb51215d7a2b

Authored by aurel32
1 parent 2ba2d706

linux-user: Linux kernel's fchmodat and faccessat have three args (no 4th arg)

In Linux kernel, fchmodat() and faccessat() take tree args.
4th value <int flags> is only processed by libc.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7187 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 8 additions and 9 deletions
linux-user/syscall.c
... ... @@ -303,15 +303,15 @@ static int sys_getcwd1(char *buf, size_t size)
303 303 */
304 304  
305 305 #ifdef TARGET_NR_faccessat
306   -static int sys_faccessat(int dirfd, const char *pathname, int mode, int flags)
  306 +static int sys_faccessat(int dirfd, const char *pathname, int mode)
307 307 {
308   - return (faccessat(dirfd, pathname, mode, flags));
  308 + return (faccessat(dirfd, pathname, mode, 0));
309 309 }
310 310 #endif
311 311 #ifdef TARGET_NR_fchmodat
312   -static int sys_fchmodat(int dirfd, const char *pathname, mode_t mode, int flags)
  312 +static int sys_fchmodat(int dirfd, const char *pathname, mode_t mode)
313 313 {
314   - return (fchmodat(dirfd, pathname, mode, flags));
  314 + return (fchmodat(dirfd, pathname, mode, 0));
315 315 }
316 316 #endif
317 317 #if defined(TARGET_NR_fchownat) && defined(USE_UID16)
... ... @@ -425,11 +425,10 @@ static int sys_utimensat(int dirfd, const char *pathname,
425 425 * Try direct syscalls instead
426 426 */
427 427 #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
428   -_syscall4(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode,int,flags)
  428 +_syscall3(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode)
429 429 #endif
430 430 #if defined(TARGET_NR_fchmodat) && defined(__NR_fchmodat)
431   -_syscall4(int,sys_fchmodat,int,dirfd,const char *,pathname,
432   - mode_t,mode,int,flags)
  431 +_syscall3(int,sys_fchmodat,int,dirfd,const char *,pathname, mode_t,mode)
433 432 #endif
434 433 #if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16)
435 434 _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname,
... ... @@ -4218,7 +4217,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
4218 4217 case TARGET_NR_faccessat:
4219 4218 if (!(p = lock_user_string(arg2)))
4220 4219 goto efault;
4221   - ret = get_errno(sys_faccessat(arg1, p, arg3, arg4));
  4220 + ret = get_errno(sys_faccessat(arg1, p, arg3));
4222 4221 unlock_user(p, arg2, 0);
4223 4222 break;
4224 4223 #endif
... ... @@ -4944,7 +4943,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
4944 4943 case TARGET_NR_fchmodat:
4945 4944 if (!(p = lock_user_string(arg2)))
4946 4945 goto efault;
4947   - ret = get_errno(sys_fchmodat(arg1, p, arg3, arg4));
  4946 + ret = get_errno(sys_fchmodat(arg1, p, arg3));
4948 4947 unlock_user(p, arg2, 0);
4949 4948 break;
4950 4949 #endif
... ...