From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 198FUY-0007BV-00 for qemu-devel@nongnu.org; Wed, 23 Apr 2003 04:20:34 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 198FTq-0006eo-00 for qemu-devel@nongnu.org; Wed, 23 Apr 2003 04:19:50 -0400 Received: from dp.samba.org ([66.70.73.150] helo=lists.samba.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 198FQK-0005fT-00 for qemu-devel@nongnu.org; Wed, 23 Apr 2003 04:16:12 -0400 From: Rusty Russell Date: Wed, 23 Apr 2003 18:13:34 +1000 Sender: rusty@rustcorp.com.au Message-Id: <20030423081611.E610A2C0A8@lists.samba.org> Subject: [Qemu-devel] [PATCH] new getrlimit support List-Id: List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , To: Fabrice Bellard Cc: cyeoh@samba.org, qemu-devel@nongnu.org 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.