Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ atexitcntl(3C) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

atexit(3C)

exit(3C)

atexitcntl(3C)

NAME

atexitcntl − atexit process termination control

SYNOPSIS

#include <atexitcntl.h>
void atexitcntl(code)
int code;

DESCRIPTION

It is intended that atexitcntl() be used to provided additional functionality to atexit(3C).  See the atexit(3C) man page for more details. 
 
When a code value of ATC_SIGENABLE is specified, all signals that by default terminate a process and are currently defined to have a signal action of SIG_DFL are modified to be caught by an internal C library routine.  This internal signal handler routine simply calls exit(3C), with the exit status parameter equal to the signal number that was passed to this handler.  By calling exit(3C), any cleanup routines that were previously specified via atexit(3C) calls will be executed.  In this way, atexitcntl() attempts to give a process the ability of executing atexit(3C) cleanup routines even when the process terminates abnormally. 
 
When a code value of ATC_SIGDISABLE is specified, all signals that were redirected to be caught by the C library’s internal atexitcntl() signal handler are reset to a signal action of SIG_DFL. 

NOTES

The ATC_SIGENABLE calls my be stacked; that is, more than one ATC_SIGENABLE atexitcntl() call may be made before calling atexitcntl() with the ATC_SIGDISABLE function code.  In this case, a matching number of ATC_SIGDISABLE calls must be made before the termination signals are reset to a SIG_DFL action. 
 
Regardless of how many ATC_SIGENABLE atexitcntl() calls are made, each ATC_SIGENABLE atexitcntl() call will check the current state of all the termination signals and internally catch any of those signals that have been set to SIG_DFL since the previous ATC_SIGENABLE call. 

RETURNS

atexitcntl() returns no status information. 

SEE ALSO

atexit(3C), exit(3C). 

BUGS

The SIGKILL signal may not be caught.  Therefore, if a process is sent this signal, it will not execute its atexit(3C) cleanup routines. 
 

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026