home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2090 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.4 KB  |  33 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!watserv1!watmath!thinkage!atbowler
  3. From: atbowler@thinkage.on.ca (Alan Bowler)
  4. Subject: Re: cleanup on exit (Was Re: Chasing memory leaks: tools, procedures?)
  5. Message-ID: <1992Jul23.214034.3843@thinkage.on.ca>
  6. Organization: /etc/organization
  7. References: <NICKEL.92Jul19184631@desaster.cs.tu-berlin.de> <9220400.530@mulga.cs.mu.OZ.AU> <NICKEL.92Jul22200234@desaster.cs.tu-berlin.de>
  8. Date: Thu, 23 Jul 1992 21:40:34 GMT
  9. Lines: 22
  10.  
  11. In article <NICKEL.92Jul22200234@desaster.cs.tu-berlin.de> nickel@cs.tu-berlin.de writes:
  12. >In article <9220400.530@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU
  13. >(Fergus James HENDERSON) writes:
  14. >
  15. >> Why not just use at_exit() to install an error handler if necessary?
  16. >
  17. >I would really *like* to use it, but it's not portable. SunOS has a
  18. >function
  19. >
  20. >    int on_exit(procp, arg)
  21. >
  22. >POSIX doesn't define something like this, SysV.3, BSD 4.3, and Ultrix
  23. >don't seem to have somthing like that.
  24. >
  25.  
  26. ANSI does define atexit().  By induction it is required by POSIX.
  27.  
  28. Since ANSI and near ANSI systems are becoming very common, this means
  29. use of atexit() is quite portable.  On many older non-ANSI
  30. implementations without atexit() as defined by ANSI, there frequently
  31. is a function like Sun's on_exit(), and in porting to those
  32. environments you can build your own atexit() using on_exit().
  33.