Skip to contentSkip to conversation

syscall: #ifdef newer RLIMIT_* codes

PATCH In review Meador Inge 3 participants 5 messages Feb 20, 2012 – Mar 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscall: #ifdef newer RLIMIT_* codes

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)').

---
 linux-user/syscall.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
linux-user/syscall.c +12 -0
index 8a11213..1986238 100644
@@ -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:
Signature · 1 line
1.7.7.6
Reviewed-by on v1 1/1
#1 lore raw

Am 20.02.2012 19:26, schrieb Meador Inge:

Quoted 5 lines

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)').

CC'ing the linux-user maintainer.

Andreas

Quoted 41 lines
---
 linux-user/syscall.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
linux-user/syscall.c +12 -0
index 8a11213..1986238 100644
@@ -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:
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw

Ping.

Quoted 55 lines · Andreas Färber

Am 20.02.2012 19:26, schrieb Meador Inge:

Quoted 5 lines

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)').

CC'ing the linux-user maintainer.

Andreas

Quoted 41 lines
---
 linux-user/syscall.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
linux-user/syscall.c +12 -0
index 8a11213..1986238 100644
@@ -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:
Signature · 3 lines
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software
#3 lore raw

Hi,

Do we really need this? 2.6.12 came out in 2005, even oldest supported RHEL (5) is minimum 2.6.18 these days.

Riku

Quoted 64 lines · Meador Inge

Ping.

Quoted 55 lines · Andreas Färber

Am 20.02.2012 19:26, schrieb Meador Inge:

Quoted 5 lines

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)').

CC'ing the linux-user maintainer.

Andreas

Quoted 41 lines
---
 linux-user/syscall.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
linux-user/syscall.c +12 -0
index 8a11213..1986238 100644
@@ -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:
Signature · 3 lines
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software
#4 lore raw
Quoted 4 lines · Riku Voipio

Hi,

Do we really need this? 2.6.12 came out in 2005, even oldest supported RHEL (5) is minimum 2.6.18 these days.

The development environment I am working with uses a RHEL 3 compatible sysroot (RHEL 3 is currently marked with "extended life cycle support"). So, I definitely need it :-) (and yes I know that this sysroot is ancient). I don't know if others are using such old development sysroots. The changes are minimal and while it would be great to have this applied upstream I do understand if you want to NACK.

Signature · 3 lines
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software