home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.21 / text0045.txt < prev    next >
Encoding:
Internet Message Format  |  1990-10-26  |  1.6 KB

  1. From:  decot@hpisod2.cup.hp.com (Dave Decot)
  2.  
  3. > Recently, while discussing pthreads, I mentioned the use of atexit()
  4. > as a way of helping thread cleanup if another thread calls exit().
  5. > It was pointed out to me that atexit() is not defined in 1003.1
  6. > 1988.
  7.  
  8. > I originally assumed that as .1 #includes all of ANSI C then atexit()
  9. > would be able to be used in a conforming application but the book
  10. > appears to indicate otherwise.
  11.  
  12. That assumption is false: only for one type of conformance is
  13. all of ANSI C required.  For other types, only interfaces reflecting
  14. "common usage in C" are required (a mostly undefined concept, unfortunately).
  15.  
  16. > So, can anyone in .1 explain whether atexit() really is required
  17. > by .1 or not and if not, what the rationale is because I don't
  18. > understand what the book is getting at.
  19. > ...
  20. > Simon Patience
  21.  
  22. atexit() is required when the implementation claims Standard C Language
  23. support, since it is required by the C Standard.
  24.  
  25. atexit() is not required for implementations that claim Common Usage C
  26. Language Support, although the fact must be documented that exit() does not
  27. work as defined by the C standard.
  28.  
  29. For the reasons stated by Simon above, I personally think it should have
  30. been included in the list of functions at the beginning of Chapter 8 of
  31. POSIX.1-1988, but wasn't.
  32.  
  33. I would like to see it (or some kind of language independent version, at least,
  34. with it required in the C binding) required by a future version of POSIX.1 .
  35.  
  36. In the mean time, I think it would be prudent for POSIX.4 and POSIX.4a to
  37. require a C Standard conforming atexit() function.
  38.  
  39. Dave Decot
  40.  
  41. Volume-Number: Volume 21, Number 46
  42.  
  43.