From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXzG8-0006wL-DL for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:06:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXzFn-0006aY-Hv for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:06:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXzFl-0006Zl-Gj for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:06:05 -0400 Received: from owa.c2.net ([207.235.78.2] helo=email.c2.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IXzFk-0000ku-Ny for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:06:04 -0400 From: Thayne Harbaugh In-Reply-To: <1190206714.9564.99.camel@phantasm.home.enterpriseandprosperity.com> References: <1190205992.9564.88.camel@phantasm.home.enterpriseandprosperity.com> <1190206302.9564.91.camel@phantasm.home.enterpriseandprosperity.com> <1190206395.9564.94.camel@phantasm.home.enterpriseandprosperity.com> <1190206457.9564.95.camel@phantasm.home.enterpriseandprosperity.com> <1190206659.9564.97.camel@phantasm.home.enterpriseandprosperity.com> <1190206714.9564.99.camel@phantasm.home.enterpriseandprosperity.com> Content-Type: multipart/mixed; boundary="=-zBjk16f36MYxhOjxRipZ" Date: Wed, 19 Sep 2007 06:59:30 -0600 Message-Id: <1190206770.9564.101.camel@phantasm.home.enterpriseandprosperity.com> Mime-Version: 1.0 Subject: [Qemu-devel] Re: [PATCH] linux-user fchownat() syscall Reply-To: thayne@c2.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-zBjk16f36MYxhOjxRipZ Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch adds the fchownat syscall to linux-user. --=-zBjk16f36MYxhOjxRipZ Content-Disposition: attachment; filename=27_fchownat.patch Content-Type: text/x-patch; name=27_fchownat.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: qemu/linux-user/syscall.c =================================================================== --- qemu.orig/linux-user/syscall.c 2007-09-19 06:21:49.000000000 -0600 +++ qemu/linux-user/syscall.c 2007-09-19 06:22:58.000000000 -0600 @@ -151,6 +151,7 @@ #define __NR_sys_uname __NR_uname +#define __NR_sys_fchownat __NR_fchownat #define __NR_sys_futimesat __NR_futimesat #define __NR_sys_getcwd1 __NR_getcwd #define __NR_sys_getdents __NR_getdents @@ -176,6 +177,10 @@ } #endif _syscall1(int,sys_uname,struct new_utsname *,buf) +#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) +_syscall5(int,sys_fchownat,int,dirfd,const char *,pathname, + uid_t,owner,gid_t,group,int,flags) +#endif #if defined(TARGET_NR_futimesat) && defined(__NR_futimesat) _syscall3(int,sys_futimesat,int,dirfd,const char *,pathname, const struct timeval *,times) @@ -4518,6 +4523,21 @@ case TARGET_NR_fchown: ret = get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3))); break; +#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) + case TARGET_NR_fchownat: + if (!arg2) { + ret = -EFAULT; + goto fail; + } + p = lock_user_string(arg2); + if (!access_ok(VERIFY_READ, p, 1)) + ret = -EFAULT; + else + ret = get_errno(sys_fchownat(arg1, p, low2highuid(arg3), low2highgid(arg4), arg5)); + if (p) + unlock_user(p, arg2, 0); + break; +#endif #ifdef TARGET_NR_setresuid case TARGET_NR_setresuid: ret = get_errno(setresuid(low2highuid(arg1), Index: qemu/linux-user/arm/syscall_nr.h =================================================================== --- qemu.orig/linux-user/arm/syscall_nr.h 2007-09-19 06:21:07.000000000 -0600 +++ qemu/linux-user/arm/syscall_nr.h 2007-09-19 06:22:15.000000000 -0600 @@ -328,5 +328,6 @@ #define TARGET_NR_openat 322 #define TARGET_NR_mkdirat 323 #define TARGET_NR_mknodat 324 +#define TARGET_NR_fchownat 325 #define TARGET_NR_futimesat 326 #define TARGET_NR_utimensat 348 --=-zBjk16f36MYxhOjxRipZ--