🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #448

Question about atexit()

#448
From: Simon Patience
Date: Mon, 20 Aug 1990 16:43
29 lines
1740 bytes
From:  sp@mysteron.osf.org (Simon Patience)

Recently, while discussing pthreads, I mentioned the use of atexit()
as a way of helping thread cleanup if another thread calls exit().
It was pointed out to me that atexit() is not defined in 1003.1
1988.

I looked it up and sure enough it is not in the fabled list of ANSI
C interfaces on page 141 and on page 183 it says that as exit()
must do all the things _exit() does then this allows 1003.1 to
ignore the atexit() function. I have to admit that I didn't understand
that logic at all as it ignores the use of atexit() by the application
to clean up inter-process state that the kernel cannot know about
(such as data consistency in shared memory etc etc).

I originally assumed that as .1 #includes all of ANSI C then atexit()
would be able to be used in a conforming application but the book
appears to indicate otherwise.

So, can anyone in .1 explain whether atexit() really is required
by .1 or not and if not, what the rationale is because I don't
understand what the book is getting at.

  Simon Patience				Phone: (617) 621-8736
  Open Software Foundation			FAX:   (617) 225-2782
  11 Cambridge Center				Email: sp@osf.org
  Cambridge MA 02142				       uunet!osf.org!sp

Volume-Number: Volume 21, Number 44
Technical Details
Message-ID: <442@usenix.ORG>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!ucbvax!usenix!std-unix

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!ucbvax!usenix!std-unix
From: sp@mysteron.osf.org (Simon Patience)
Newsgroups: comp.std.unix
Subject: Question about atexit()
Message-ID: <442@usenix.ORG>
Date: 20 Aug 90 16:43:20 GMT
Sender: std-unix@usenix.ORG
Reply-To: sp@mysteron.osf.org (Simon Patience)
Organization: Open Software Foundation
Lines: 29
Approved: jsq@usenix.org (Moderator, John Quarterman)
X-Submissions: std-unix@uunet.uu.net