public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] abort: clarify consequences of calling abort
@ 2023-07-20 15:38 Tomáš Golembiovský
  2023-07-20 15:40 ` Tomáš Golembiovský
  2023-07-26 11:38 ` G. Branden Robinson
  0 siblings, 2 replies; 4+ messages in thread
From: Tomáš Golembiovský @ 2023-07-20 15:38 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: linux-man, Tomáš Golembiovský, G. Branden Robinson,
	Stefan Puiu

Clarify that atexit/on_exit are not called because those are called only
on normal process termination (as documented on their respective manual
pages).

Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
---
 man3/abort.3 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/man3/abort.3 b/man3/abort.3
index c63eace5e..8e1554eae 100644
--- a/man3/abort.3
+++ b/man3/abort.3
@@ -47,6 +47,10 @@ function will still terminate the process.
 It does this by restoring the default disposition for
 .B SIGABRT
 and then raising the signal for a second time.
+.PP
+As with other cases of abnormal termination the functions registered with
+.BR atexit "(3) and " on_exit (3)
+are not called.
 .SH RETURN VALUE
 The
 .BR abort ()
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] abort: clarify consequences of calling abort
  2023-07-20 15:38 [PATCH v4] abort: clarify consequences of calling abort Tomáš Golembiovský
@ 2023-07-20 15:40 ` Tomáš Golembiovský
  2023-07-26 11:38 ` G. Branden Robinson
  1 sibling, 0 replies; 4+ messages in thread
From: Tomáš Golembiovský @ 2023-07-20 15:40 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, G. Branden Robinson, Stefan Puiu

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

Hi,

attached is a small test program. Compile simply with:

    $ gcc atexit.c -o atexit

When running the test I get:

    $ ./atexit 
    terminating
    on_exit called
    atexit called

When the abort() call is uncommented I get:

    $ ./atexit 
    terminating
    Aborted (core dumped)

Hope this helps,

    Tomas

[-- Attachment #2: atexit.c --]
[-- Type: text/plain, Size: 292 bytes --]

#define _DEFAULT_SOURCE

#include <stdio.h>
#include <stdlib.h>

void one(void) {
    puts("atexit called");
}

void two(int, void*) {
    puts("on_exit called");
}

int main(void) {
    atexit(one);
    on_exit(two, NULL);

    puts("terminating");
    //abort();
    exit (EXIT_SUCCESS);
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] abort: clarify consequences of calling abort
  2023-07-20 15:38 [PATCH v4] abort: clarify consequences of calling abort Tomáš Golembiovský
  2023-07-20 15:40 ` Tomáš Golembiovský
@ 2023-07-26 11:38 ` G. Branden Robinson
  2023-07-26 12:56   ` Tomáš Golembiovský
  1 sibling, 1 reply; 4+ messages in thread
From: G. Branden Robinson @ 2023-07-26 11:38 UTC (permalink / raw)
  To: Tomáš Golembiovský
  Cc: Alejandro Colomar, linux-man, Stefan Puiu

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

Hi Tomáš,

At 2023-07-20T17:38:01+0200, Tomáš Golembiovský wrote:
> Clarify that atexit/on_exit are not called because those are called
> only on normal process termination (as documented on their respective
> manual pages).
> 
> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
> Cc: Stefan Puiu <stefan.puiu@gmail.com>
> Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
[...]
> +.BR atexit "(3) and " on_exit (3)

You might recast this line as:

.BR atexit (3)
and
.BR on_exit (3)

...because it's (a) a little more readable (no quoted spaces) and (b) it
be easily pattern-matched to migrate the man page cross references to
the new `MR` macro in groff 1.23.0 (released at last), and for which I'm
(slowly) working up a sed script.

There are plenty of special cases to handle, but stemming the influx of
new ones will help.  :)

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] abort: clarify consequences of calling abort
  2023-07-26 11:38 ` G. Branden Robinson
@ 2023-07-26 12:56   ` Tomáš Golembiovský
  0 siblings, 0 replies; 4+ messages in thread
From: Tomáš Golembiovský @ 2023-07-26 12:56 UTC (permalink / raw)
  To: G. Branden Robinson; +Cc: Alejandro Colomar, linux-man, Stefan Puiu

Sure I will do that and resend.

Thanks,

    Tomas

On Wed, Jul 26, 2023 at 06:38:36AM -0500, G. Branden Robinson wrote:
> Hi Tomáš,
> 
> At 2023-07-20T17:38:01+0200, Tomáš Golembiovský wrote:
> > Clarify that atexit/on_exit are not called because those are called
> > only on normal process termination (as documented on their respective
> > manual pages).
> > 
> > Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
> > Cc: Stefan Puiu <stefan.puiu@gmail.com>
> > Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
> [...]
> > +.BR atexit "(3) and " on_exit (3)
> 
> You might recast this line as:
> 
> .BR atexit (3)
> and
> .BR on_exit (3)
> 
> ...because it's (a) a little more readable (no quoted spaces) and (b) it
> be easily pattern-matched to migrate the man page cross references to
> the new `MR` macro in groff 1.23.0 (released at last), and for which I'm
> (slowly) working up a sed script.
> 
> There are plenty of special cases to handle, but stemming the influx of
> new ones will help.  :)
> 
> Regards,
> Branden



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-26 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-20 15:38 [PATCH v4] abort: clarify consequences of calling abort Tomáš Golembiovský
2023-07-20 15:40 ` Tomáš Golembiovský
2023-07-26 11:38 ` G. Branden Robinson
2023-07-26 12:56   ` Tomáš Golembiovský

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox