qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] new getrlimit support


From: Rusty Russell
Subject: [Qemu-devel] [PATCH] new getrlimit support
Date: Wed, 23 Apr 2003 18:13:34 +1000

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]