Re: atexit vs. on_exit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: atexit vs. on_exit
Date: 2011-12-22 22:04:03
Message-ID: 29769.1324591443@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Are there any supported platforms that have only on_exit() but not
> atexit()?

Trolling the git logs shows that configure's support for on_exit was
added here:

commit df247b821d811abcfc0ac707e1a3af9dfce474c9
Author: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Date: Tue Feb 27 08:13:31 2001 +0000

Massive commits for SunOS4 port.

SunOS4 is definitely pretty dead. According to the info I have,
atexit() is required by ANSI C (that would be C89 not C99), so it
certainly seems unlikely that we'd ever see platforms without it
anymore.

A slightly different issue is that atexit is less functional than
on_exit (the former does not tell the callbacks the exit() code).
There is one place in our code where it would be nice to have that.
But since we're preferring atexit where available, we seem to be
getting along fine without it anyway.

+1 for simplifying.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-12-22 22:37:17 Re: Page Checksums + Double Writes
Previous Message Simon Riggs 2011-12-22 21:58:20 Re: Page Checksums + Double Writes