* [Qemu-devel] [PATCH] new getrlimit support
@ 2003-04-23 8:13 Rusty Russell
0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2003-04-23 8:13 UTC (permalink / raw)
To: Fabrice Bellard; +Cc: cyeoh, qemu-devel
In the process of running the POSIX test cases under qemu, Chris found
the following was missing.
Name: Implement new getrlimit
Author: Rusty Russell
Status: Briefly Tested
D: Implements the "new" x86 getrlimit call.
diff -urpN --exclude TAGS -X /home/rusty/current-dontdiff --minimal qemu-0.1.6-debug/syscall.c qemu-0.1.6-ugetrlimit/syscall.c
--- qemu-0.1.6-debug/syscall.c 2003-04-23 17:41:01.000000000 +1000
+++ qemu-0.1.6-ugetrlimit/syscall.c 2003-04-23 17:53:49.000000000 +1000
@@ -2238,7 +2238,16 @@ long do_syscall(void *cpu_env, int num,
ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0));
break;
case TARGET_NR_ugetrlimit:
- goto unimplemented;
+ {
+ struct rlimit rlim;
+ ret = get_errno(getrlimit(arg1, &rlim));
+ if (!is_error(ret)) {
+ struct target_rlimit *target_rlim = (void *)arg2;
+ target_rlim->rlim_cur = tswapl(rlim.rlim_cur);
+ target_rlim->rlim_max = tswapl(rlim.rlim_max);
+ }
+ break;
+ }
case TARGET_NR_truncate64:
goto unimplemented;
case TARGET_NR_ftruncate64:
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-04-23 8:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-23 8:13 [Qemu-devel] [PATCH] new getrlimit support Rusty Russell
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).