From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzZ3w-0003mA-JG for qemu-devel@nongnu.org; Mon, 20 Feb 2012 14:38:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzZ3v-0001au-9N for qemu-devel@nongnu.org; Mon, 20 Feb 2012 14:38:16 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60402 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzZ3v-0001ak-09 for qemu-devel@nongnu.org; Mon, 20 Feb 2012 14:38:15 -0500 Message-ID: <4F42A124.8080406@suse.de> Date: Mon, 20 Feb 2012 20:38:12 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1329762416-6012-1-git-send-email-meadori@codesourcery.com> In-Reply-To: <1329762416-6012-1-git-send-email-meadori@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 1/1] syscall: #ifdef newer RLIMIT_* codes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Meador Inge Cc: Riku Voipio , qemu-devel@nongnu.org Am 20.02.2012 19:26, schrieb Meador Inge: > Commit e22b7015353be824620b1f0f5e32a8575b898a8c added the translation > from target to host RLIMIT_* codes, but some of the added codes are > only available on newer version of Linux (as documented in 'getrlimit(2= )'). >=20 > Signed-off-by: Meador Inge Reviewed-by: Andreas F=E4rber CC'ing the linux-user maintainer. Andreas > --- > linux-user/syscall.c | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) >=20 > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 8a11213..1986238 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -996,20 +996,32 @@ static inline int target_to_host_resource(int cod= e) > return RLIMIT_LOCKS; > case TARGET_RLIMIT_MEMLOCK: > return RLIMIT_MEMLOCK; > +/* >=3D Linux 2.6.8 */ > +#ifdef RLIMIT_MSGQUEUE > case TARGET_RLIMIT_MSGQUEUE: > return RLIMIT_MSGQUEUE; > +#endif > +/* >=3D Linux 2.6.12 */ > +#ifdef RLIMIT_NICE > case TARGET_RLIMIT_NICE: > return RLIMIT_NICE; > +#endif > case TARGET_RLIMIT_NOFILE: > return RLIMIT_NOFILE; > case TARGET_RLIMIT_NPROC: > return RLIMIT_NPROC; > case TARGET_RLIMIT_RSS: > return RLIMIT_RSS; > +/* >=3D Linux 2.6.12 */ > +#ifdef RLIMIT_RTPRIO > case TARGET_RLIMIT_RTPRIO: > return RLIMIT_RTPRIO; > +#endif > +/* >=3D Linux 2.6.8 */ > +#ifdef RLIMIT_SIGPENDING > case TARGET_RLIMIT_SIGPENDING: > return RLIMIT_SIGPENDING; > +#endif > case TARGET_RLIMIT_STACK: > return RLIMIT_STACK; > default: --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg