🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3936

atexit/exit problem

#3936
From: walter briscoe
Date: Wed, 06 Sep 1995 15:20
19 lines
1316 bytes
I find the interaction between exit and atexit confusing.
atexit registers a function to be called at normal program termination.
Normal program termination is equivalent to a call of exit.
I would like to have access to the parameter with which exit is called.
Ideally, I would like to have write access to it. i.e. I would like
atexit to be respecified as int atexit ( void ( * func ) ( int * ) ).

There is prior art in an undocumented feature of the VAX/VMS C 3.*
compilers.  The ability to react to a termination condition passed as a
parameter seems better than using shared data.  I don't envisage any
circumstances in which I would want to modify the condition but like the
concept of being able to do so.

I am also surprised that the standard does not append to the description
of atexit something like: Whether that function is called at abnormal
program termination is implementation-defined.

-- 
walter briscoe
Technical Details
Message-ID: <810400848snz@wbriscoe.demon.co.uk>
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!wbriscoe.demon.co.uk

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!wbriscoe.demon.co.uk
From: walter briscoe <walter@wbriscoe.demon.co.uk>
Newsgroups: comp.std.c
Subject: atexit/exit problem
Date: Wed, 06 Sep 95 15:20:48 GMT
Message-ID: <810400848snz@wbriscoe.demon.co.uk>
Reply-To: walter@wbriscoe.demon.co.uk
X-NNTP-Posting-Host: wbriscoe.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.30