@@ -789,6 +789,10 @@ safe_syscall6(ssize_t, copy_file_range, int, infd, loff_t *, pinoff,
789
789
int , outfd , loff_t * , poutoff , size_t , length ,
790
790
unsigned int , flags )
791
791
#endif
792
+ #if defined(TARGET_NR_fchmodat2 ) && defined(__NR_fchmodat2 )
793
+ safe_syscall4 (int , fchmodat2 , int , dfd , const char * , filename ,
794
+ unsigned short , mode , unsigned int , flags )
795
+ #endif
792
796
793
797
/* We do ioctl like this rather than via safe_syscall3 to preserve the
794
798
* "third argument might be integer or pointer or not present" behaviour of
@@ -10709,6 +10713,15 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
10709
10713
ret = get_errno (fchmodat (arg1 , p , arg3 , 0 ));
10710
10714
unlock_user (p , arg2 , 0 );
10711
10715
return ret ;
10716
+ #endif
10717
+ #if defined(TARGET_NR_fchmodat2 ) && defined(__NR_fchmodat2 )
10718
+ case TARGET_NR_fchmodat2 :
10719
+ if (!(p = lock_user_string (arg2 ))) {
10720
+ return - TARGET_EFAULT ;
10721
+ }
10722
+ ret = get_errno (safe_fchmodat2 (arg1 , p , arg3 , arg4 ));
10723
+ unlock_user (p , arg2 , 0 );
10724
+ return ret ;
10712
10725
#endif
10713
10726
case TARGET_NR_getpriority :
10714
10727
/* Note that negative values are valid for getpriority, so we must
0 commit comments