From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] {get,set}groups32 syscalls
Date: Mon, 31 Jan 2005 04:01:44 +0000 [thread overview]
Message-ID: <200501310401.44748.paul@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 79 bytes --]
The attached patch implements the getgroups32 and setgroups32 syscalls.
Paul
[-- Attachment #2: patch.qemu_groups32 --]
[-- Type: text/x-diff, Size: 1545 bytes --]
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;
reply other threads:[~2005-01-31 4:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200501310401.44748.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).