%SYN_ATEXIT

Register a routine to be called when a service shuts down

WSupported on Windows
USupported on Unix
VSupported on OpenVMS

 

return = %SYN_ATEXIT(address)

or

xcall SYN_ATEXIT(address)

Return value

return

1.

Arguments

address

The address of the routine to register (in other words, the output of a call to %XADDR). (i)

Discussion

%SYN_ATEXIT registers a routine to be called under the following circumstances.

On

The specified routine is called when

Windows

The program running as a service with dbssvc is stopped by the stop service requested from the Services Control Panel (or NET STOP service_name).

Unix

A process is stopped by SIGHUP or SIGTERM(-15).

OpenVMS

A process is stopped using the $FORCEX system service.

Examples

status = %syn_atexit(%xaddr("MY_ROUTINE"))