From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CvT77-0000ZI-0k for qemu-devel@nongnu.org; Sun, 30 Jan 2005 23:24:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CvT6t-0000Tb-Bb for qemu-devel@nongnu.org; Sun, 30 Jan 2005 23:24:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvT6s-0000QU-Cx for qemu-devel@nongnu.org; Sun, 30 Jan 2005 23:24:22 -0500 Received: from [65.74.133.9] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CvSl3-0000Id-97 for qemu-devel@nongnu.org; Sun, 30 Jan 2005 23:01:49 -0500 From: Paul Brook Date: Mon, 31 Jan 2005 04:01:44 +0000 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_o2a/BK2OUM4c+Je" Message-Id: <200501310401.44748.paul@codesourcery.com> Subject: [Qemu-devel] {get,set}groups32 syscalls Reply-To: 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 --Boundary-00=_o2a/BK2OUM4c+Je Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline The attached patch implements the getgroups32 and setgroups32 syscalls. Paul --Boundary-00=_o2a/BK2OUM4c+Je Content-Type: text/x-diff; charset="us-ascii"; name="patch.qemu_groups32" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.qemu_groups32" Index: linux-user/syscall.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/syscall.c,v retrieving revision 1.55 diff -u -p -r1.55 syscall.c --- linux-user/syscall.c 3 Jan 2005 23:31:27 -0000 1.55 +++ linux-user/syscall.c 31 Jan 2005 03:51:03 -0000 @@ -2916,9 +2916,33 @@ long do_syscall(void *cpu_env, int num, ret = get_errno(setregid(arg1, arg2)); break; case TARGET_NR_getgroups32: - goto unimplemented; + { + int gidsetsize = arg1; + uint32_t *target_grouplist = (void *)arg2; + gid_t *grouplist; + int i; + + grouplist = alloca(gidsetsize * sizeof(gid_t)); + ret = get_errno(getgroups(gidsetsize, grouplist)); + if (!is_error(ret)) { + for(i = 0;i < gidsetsize; i++) + target_grouplist[i] = tswap32(grouplist[i]); + } + } + break; case TARGET_NR_setgroups32: - goto unimplemented; + { + int gidsetsize = arg1; + uint32_t *target_grouplist = (void *)arg2; + gid_t *grouplist; + int i; + + grouplist = alloca(gidsetsize * sizeof(gid_t)); + for(i = 0;i < gidsetsize; i++) + grouplist[i] = tswap32(target_grouplist[i]); + ret = get_errno(setgroups(gidsetsize, grouplist)); + } + break; case TARGET_NR_fchown32: ret = get_errno(fchown(arg1, arg2, arg3)); break; --Boundary-00=_o2a/BK2OUM4c+Je--