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,15 +303,15 @@ static int sys_getcwd1(char *buf, size_t size)
303 */ 303 */
304 304
305 #ifdef TARGET_NR_faccessat 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 #endif 310 #endif
311 #ifdef TARGET_NR_fchmodat 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 #endif 316 #endif
317 #if defined(TARGET_NR_fchownat) && defined(USE_UID16) 317 #if defined(TARGET_NR_fchownat) && defined(USE_UID16)
@@ -425,11 +425,10 @@ static int sys_utimensat(int dirfd, const char *pathname, @@ -425,11 +425,10 @@ static int sys_utimensat(int dirfd, const char *pathname,
425 * Try direct syscalls instead 425 * Try direct syscalls instead
426 */ 426 */
427 #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat) 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 #endif 429 #endif
430 #if defined(TARGET_NR_fchmodat) && defined(__NR_fchmodat) 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 #endif 432 #endif
434 #if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16) 433 #if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16)
435 _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname, 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,7 +4217,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
4218 case TARGET_NR_faccessat: 4217 case TARGET_NR_faccessat:
4219 if (!(p = lock_user_string(arg2))) 4218 if (!(p = lock_user_string(arg2)))
4220 goto efault; 4219 goto efault;
4221 - ret = get_errno(sys_faccessat(arg1, p, arg3, arg4)); 4220 + ret = get_errno(sys_faccessat(arg1, p, arg3));
4222 unlock_user(p, arg2, 0); 4221 unlock_user(p, arg2, 0);
4223 break; 4222 break;
4224 #endif 4223 #endif
@@ -4944,7 +4943,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, @@ -4944,7 +4943,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
4944 case TARGET_NR_fchmodat: 4943 case TARGET_NR_fchmodat:
4945 if (!(p = lock_user_string(arg2))) 4944 if (!(p = lock_user_string(arg2)))
4946 goto efault; 4945 goto efault;
4947 - ret = get_errno(sys_fchmodat(arg1, p, arg3, arg4)); 4946 + ret = get_errno(sys_fchmodat(arg1, p, arg3));
4948 unlock_user(p, arg2, 0); 4947 unlock_user(p, arg2, 0);
4949 break; 4948 break;
4950 #endif 4949 #endif