PatchSet 4823 
Date: 2004/06/04 20:28:14
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixed stack size detection on some linux architectures.

        * config/m68k/linux/md.h,
        config/powerpc/linux/md.h: Implemented mdGetStackSize().

        * config/i386/linux/md.h: Cleaned up as soft limits are always
        the lower bound in the Linux kernel.

Members: 
        ChangeLog:1.2391->1.2392 
        config/i386/linux/md.h:1.12->1.13 
        config/m68k/linux/md.h:1.8->1.9 
        config/powerpc/linux/md.h:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2391 kaffe/ChangeLog:1.2392
--- kaffe/ChangeLog:1.2391      Fri Jun  4 19:32:32 2004
+++ kaffe/ChangeLog     Fri Jun  4 20:28:14 2004
@@ -1,5 +1,13 @@
 2004-06-04  Guilhem Lavaux <[EMAIL PROTECTED]>
 
+       * config/m68k/linux/md.h,
+       config/powerpc/linux/md.h: Implemented mdGetStackSize().
+
+       * config/i386/linux/md.h: Cleaned up as soft limits are always
+       the lower bound in the Linux kernel.
+
+2004-06-04  Guilhem Lavaux <[EMAIL PROTECTED]>
+
        * po/fr.po, po/kaffe.pot: New files.
 
        * po/LINGUAS: Added fr.
Index: kaffe/config/i386/linux/md.h
diff -u kaffe/config/i386/linux/md.h:1.12 kaffe/config/i386/linux/md.h:1.13
--- kaffe/config/i386/linux/md.h:1.12   Sun May  9 14:20:12 2004
+++ kaffe/config/i386/linux/md.h        Fri Jun  4 20:28:15 2004
@@ -83,10 +83,12 @@
 {
   struct rlimit rl;
 
+  // The soft limit is always the lower limit.
+  // Use it by default.
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
     return 0;
   else
-    return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
+    return rl.rlim_cur;
 }
 #endif
 
Index: kaffe/config/m68k/linux/md.h
diff -u kaffe/config/m68k/linux/md.h:1.8 kaffe/config/m68k/linux/md.h:1.9
--- kaffe/config/m68k/linux/md.h:1.8    Wed Apr 28 17:03:55 2004
+++ kaffe/config/m68k/linux/md.h        Fri Jun  4 20:28:16 2004
@@ -40,6 +40,23 @@
 extern void init_md(void);
 #define        INIT_MD()       init_md()
 
+#if defined(HAVE_GETRLIMIT)
+#define KAFFEMD_STACKSIZE
+
+static inline rlim_t mdGetStackSize(void)
+{
+  struct rlimit rl;
+
+  // The soft limit is always the lower limit.
+  // Use it by default.
+  if (getrlimit(RLIMIT_STACK, &rl) < 0)
+    return 0;
+  else
+    return rl.rlim_cur;
+}
+#endif
+
+
 /*
  * sysdepCallMethod supports:
  *
Index: kaffe/config/powerpc/linux/md.h
diff -u kaffe/config/powerpc/linux/md.h:1.5 kaffe/config/powerpc/linux/md.h:1.6
--- kaffe/config/powerpc/linux/md.h:1.5 Tue Apr 27 18:25:17 2004
+++ kaffe/config/powerpc/linux/md.h     Fri Jun  4 20:28:16 2004
@@ -28,4 +28,21 @@
 #define SIGNAL_ARGS(sig, sc) int sig
 #undef HAVE_SIGALTSTACK
 
+#if defined(HAVE_GETRLIMIT)
+#define KAFFEMD_STACKSIZE
+
+static inline rlim_t mdGetStackSize(void)
+{
+  struct rlimit rl;
+
+  // The soft limit is always the lower limit.
+  // Use it by default.
+  if (getrlimit(RLIMIT_STACK, &rl) < 0)
+    return 0;
+  else
+    return rl.rlim_cur;
+}
+#endif
+
+
 #endif

_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to