home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / hp / 8517 < prev    next >
Encoding:
Text File  |  1992-07-25  |  3.0 KB  |  86 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!destroyer!fmsrl7!ef2007!mjo
  3. From: mjo@ef2007.efhd.ford.com (Mike O'Connor)
  4. Subject: Re: Inhibiting core dumps on HP7xx
  5. Message-ID: <Brwwx9.CyL@ef2007.efhd.ford.com>
  6. X-Disclaimer: Not an official spokesperson for Ford OPEO
  7. Reply-To: Mike O'Connor <mjo@fmsrl7.srl.ford.com>
  8. Organization: International Affairs, Overseas Engineering, "Fordz"
  9. References: <1992Jul24.145006.20539@hubcap.clemson.edu> <7371168@hpfcso.FC.HP.COM>
  10. Date: Fri, 24 Jul 1992 21:27:09 GMT
  11. Lines: 73
  12.  
  13. In article <7371168@hpfcso.FC.HP.COM> acmeyer@hpfcso.FC.HP.COM (Alan
  14. C. Meyer) writes:
  15.  
  16. :In comp.sys.hp, elwin@gamma.phys.clemson.edu (Lawrence E. Brown) writes:
  17. :
  18. :> I'm very tired of frequent dumps of 10-40Meg core files every
  19. :> time I have a floating exception somewhere in my code (mostly
  20. :> Fortran some C).  Is there any way to prevent core dumps in
  21. :> HPUX8.0x on an HP700 series machine? 
  22. :
  23. :Here is some information if you are using a Fortran main program.  By
  24. :default, trapping for floating point exceptions are not enabled.  For
  25.  
  26. Thank you for being informative and all...  but this really doesn't
  27. answer the question.  Under the underline is some code I have not
  28. tried out that claims it'll take care of HP core dumps.
  29.  
  30. Will the ability to limit core dump sizes be present in HP-UX 9.0????
  31. Can someone from HP please comment?  
  32.  
  33.  
  34. ------------------------------------------------------------------------
  35.  
  36. I asked this question myself a few months back, and got a wonderful example
  37. program from hooft@prl.philips.nl showing that the BSD hooks are still
  38. in the HP-UX kernal.  I ended up with a program called "nocore".  I am in
  39. the process of trying to get this into the Interworks library, but since
  40. it is so short, I am appending it here.
  41.  
  42. Good luck!
  43.  
  44. Russell Randolph
  45. nCUBE, Beaverton, Oregon
  46. russell@ncube.com
  47.  
  48. /* -------------------------------  nocore.c  ------------------------------- */
  49. /* Prevents core dumps from whatever is run.
  50.  * Tested on HP-UX 8.07 on 7xx series.
  51.  * To compile: cc -o nocore -I/etc/conf/h -D_KERNEL nocore.c
  52.  * Modified from example program by hooft@prl.philips.nl
  53.  * Russell Randolph (russell@ncube.com)
  54.  * Date:  Thu Jul 16 1992
  55.  */
  56.  
  57. #include <stdio.h>
  58. #include <sys/resource.h>
  59.  
  60. main(argc,argv)
  61.   int argc;
  62.   char *argv[];
  63. {
  64.     struct rlimit rl;
  65.  
  66.     if (argc == 1) {
  67.       fprintf(stderr,"Usage:    nocore <programname> [arguements ...]\n");
  68.       fprintf(stderr,"Example:  nocore spice -b circuit.sp\n");
  69.       fprintf(stderr,"Example:  exec nocore $SHELL\n");
  70.       fprintf(stderr,"Note:  child processes will also have their core limits set to 0 bytes.\n");
  71.       exit(1);
  72.     }
  73.     getrlimit(RLIMIT_CORE, &rl);
  74.     rl.rlim_cur = 0;
  75.     setrlimit(RLIMIT_CORE, &rl);
  76.     *argv++;
  77.     execvp(*argv,argv);
  78.     fprintf(stderr,"Error:  execvp of %s failed.\n", *argv);
  79.     exit(1);
  80. }
  81. -- 
  82.  Michael J. O'Connor           |  Internet:  mjo@fmsrl7.srl.ford.com
  83.  Ford Motor Company, OPEO      |  UUCP:      ...!{backbone}!fmsrl7!mjo
  84.  20000 Rotunda, Bldg. 1-3001   |  Phone:     +1 (313) 248-1260
  85.  Dearborn, MI  48121           |  Fax:       +1 (313) 323-6277
  86.