Received: from eggs.gnu.org ([140.186.70.92]:53218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzXx2-00053O-54 for qemu-devel@nongnu.org; Mon, 20 Feb 2012 13:27:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzXwy-0002Gq-FO for qemu-devel@nongnu.org; Mon, 20 Feb 2012 13:27:04 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:54330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzXwx-0002Gi-Vh for qemu-devel@nongnu.org; Mon, 20 Feb 2012 13:27:00 -0500 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1RzXww-0005fq-7j from meador_inge@mentor.com for qemu-devel@nongnu.org; Mon, 20 Feb 2012 10:26:58 -0800 From: Meador Inge Date: Mon, 20 Feb 2012 12:26:56 -0600 Message-ID: <1329762416-6012-1-git-send-email-meadori@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v1 1/1] syscall: #ifdef newer RLIMIT_* codes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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)'). Signed-off-by: Meador Inge --- linux-user/syscall.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) 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 code) return RLIMIT_LOCKS; case TARGET_RLIMIT_MEMLOCK: return RLIMIT_MEMLOCK; +/* >= Linux 2.6.8 */ +#ifdef RLIMIT_MSGQUEUE case TARGET_RLIMIT_MSGQUEUE: return RLIMIT_MSGQUEUE; +#endif +/* >= 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; +/* >= Linux 2.6.12 */ +#ifdef RLIMIT_RTPRIO case TARGET_RLIMIT_RTPRIO: return RLIMIT_RTPRIO; +#endif +/* >= Linux 2.6.8 */ +#ifdef RLIMIT_SIGPENDING case TARGET_RLIMIT_SIGPENDING: return RLIMIT_SIGPENDING; +#endif case TARGET_RLIMIT_STACK: return RLIMIT_STACK; default: -- 1.7.7.6