[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 1/1] syscall: #ifdef newer RLIMIT_* codes
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH v1 1/1] syscall: #ifdef newer RLIMIT_* codes |
Date: |
Mon, 20 Feb 2012 20:38:12 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 |
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)').
>
> Signed-off-by: Meador Inge <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
CC'ing the linux-user maintainer.
Andreas
> ---
> 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:
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg