Question about atexit()

Donn Terry donn at hpfcrn.fc.hp.com
Thu Aug 23 02:30:42 AEST 1990


From:  Donn Terry <donn at hpfcrn.fc.hp.com>

The list at the beginning of chapter 8 is NOT a list of the requirements
of POSIX.1 on the C standard, although it is often misread that way.

It is a list of functions *from the C standard* that must be provided
by a "common usage" implementation.   That list will (as far as I can
predict) be completely removed from the first version of the standard
that doesn't discuss common usage, and rely solely on the pointer from
POSIX.1 C-language binding to X3.159/ISO 9xxx (someone can fill in the
number, I forget) for all Standard C functions.

Also, if you read the requirements on common usage closely enough, you
realize that if you document it well enough, you probably could get
away with a Fortran compiler.  (OK... maybe that's an exaggeration, but
not by a whole lot.)

Doug Gwyn is right: specify the Standard C conformant option to POSIX
(or simply specify Standard C) and you'll get atexit(). 

(Also, until POSIX.1 is stated in terms soley of Standard C (when it
ceases to be necessary), there is nothing at all to prevent POSIX.4 from
requiring that atexit() with the Standard C semantics be provided in
common-usage implementations.  POSIX.4 could also simply require 
Standard C to be conformant, although I doubt that that would succeed
in balloting.)

Atexit() was omitted primarily because it was an X3J11 invetion that was
not rapidly being included in common usage compilers.  Since (transitional)
backwards compatabilty of implementations was a concern for POSIX.1,
that was a reasonable decision two years (or more) ago.

Donn Terry
Speaking only for myself, as I always have to say.

volume-Number: Volume 21, Number 52



More information about the Comp.std.unix mailing list