patch-pfe_main-stdc_c 934 B

123456789101112131415161718192021222324252627282930313233
  1. $OpenBSD: patch-pfe_main-stdc_c,v 1.1 2008/10/16 17:30:24 jasper Exp $
  2. --- pfe/main-stdc.c.orig Sun Apr 20 06:46:30 2008
  3. +++ pfe/main-stdc.c Thu Oct 16 12:37:46 2008
  4. @@ -28,6 +28,7 @@ static char* id __attribute__((unused)) =
  5. #include <errno.h>
  6. #ifdef PFE_HAVE_SYS_RESOURCE_H
  7. +#include <sys/types.h>
  8. #include <sys/time.h>
  9. #include <sys/resource.h>
  10. #endif
  11. @@ -57,9 +58,17 @@ main (int argc, const char** argv)
  12. # endif
  13. # ifdef PFE_HAVE_SYS_RESOURCE_H
  14. - {/* a pfe does not need lots of data on the real cpu return stack */
  15. - struct rlimit rlimits = { 64*1024, 64*1024 };
  16. - setrlimit (RLIMIT_STACK, &rlimits);
  17. + {
  18. + /*
  19. + * A pfe does not need lots of data on the real cpu return stack.
  20. + * So, grow the maximum stack a size.
  21. + */
  22. + struct rlimit reslimit;
  23. +
  24. + if (getrlimit(RLIMIT_STACK , &reslimit) == 0){
  25. + reslimit.rlim_cur = reslimit.rlim_max;
  26. + (void)setrlimit(RLIMIT_STACK , &reslimit);
  27. + }
  28. }
  29. # endif