Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXzEn-0005vo-Qb for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:05:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXzEm-0005v2-8s for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:05:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXzEm-0005uy-3B for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:05:04 -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 1IXzEl-0000Xv-M9 for qemu-devel@nongnu.org; Wed, 19 Sep 2007 09:05:03 -0400 From: Thayne Harbaugh In-Reply-To: <1190206659.9564.97.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> Content-Type: multipart/mixed; boundary="=-/smrB09b55kDj+ugkL2w" Date: Wed, 19 Sep 2007 06:58:33 -0600 Message-Id: <1190206714.9564.99.camel@phantasm.home.enterpriseandprosperity.com> Mime-Version: 1.0 Subject: [Qemu-devel] Re: [PATCH] linux-user mknodat() 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 --=-/smrB09b55kDj+ugkL2w Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch adds the mknodat syscall to linux-user. --=-/smrB09b55kDj+ugkL2w Content-Disposition: attachment; filename=26_mknodat.patch Content-Type: text/x-patch; name=26_mknodat.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: qemu/linux-user/syscall.c =================================================================== --- qemu.orig/linux-user/syscall.c 2007-09-19 06:20:59.000000000 -0600 +++ qemu/linux-user/syscall.c 2007-09-19 06:21:49.000000000 -0600 @@ -156,6 +156,7 @@ #define __NR_sys_getdents __NR_getdents #define __NR_sys_getdents64 __NR_getdents64 #define __NR_sys_mkdirat __NR_mkdirat +#define __NR_sys_mknodat __NR_mknodat #define __NR_sys_openat __NR_openat #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo #define __NR_sys_syslog __NR_syslog @@ -189,6 +190,10 @@ #if defined(TARGET_NR_mkdirat) && defined(__NR_mkdirat) _syscall3(int,sys_mkdirat,int,dirfd,const char *,pathname,mode_t,mode) #endif +#if defined(TARGET_NR_mknodat) && defined(__NR_mknodat) +_syscall4(int,sys_mknodat,int,dirfd,const char *,pathname, + mode_t,mode,dev_t,dev) +#endif #if defined(TARGET_NR_openat) && defined(__NR_openat) _syscall4(int,sys_openat,int,dirfd,const char *,pathname,int,flags,mode_t,mode) #endif @@ -2828,6 +2833,21 @@ ret = get_errno(mknod(p, arg2, arg3)); unlock_user(p, arg1, 0); break; +#if defined(TARGET_NR_mknodat) && defined(__NR_mknodat) + case TARGET_NR_mknodat: + 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_mknodat(arg1, p, arg3, arg4)); + if (p) + unlock_user(p, arg2, 0); + break; +#endif case TARGET_NR_chmod: p = lock_user_string(arg1); ret = get_errno(chmod(p, arg2)); Index: qemu/linux-user/arm/syscall_nr.h =================================================================== --- qemu.orig/linux-user/arm/syscall_nr.h 2007-09-19 06:20:24.000000000 -0600 +++ qemu/linux-user/arm/syscall_nr.h 2007-09-19 06:21:07.000000000 -0600 @@ -327,5 +327,6 @@ #define TARGET_NR_set_mempolicy 321 #define TARGET_NR_openat 322 #define TARGET_NR_mkdirat 323 +#define TARGET_NR_mknodat 324 #define TARGET_NR_futimesat 326 #define TARGET_NR_utimensat 348 --=-/smrB09b55kDj+ugkL2w--