cobpostsighandler

Adds the specified handler to the list of handlers for the specified signal, at the specified priority.
Restriction: This function is supported for native COBOL only.

Syntax:

#include "cobsignal.h"

cobsigtype_t cobpostsighandler (int signal, int priority, 
    PFI_SIG handler); 

Parameters:

signal Signal number, as defined in the <signal.h> include file.
priority The priority of handler in the range 1 to 254, where 254 is the highest priority. Values 127 and 129 through 139 are reserved for our use.
handler Address of your signal handler. This must be a C function that returns an integer value.

Comments:

  • This function adds the specified handler to the list of handles for the specified signal, at the specified priority.
  • This function returns a pointer that you can use to remove your signal handler later. If the return value is NULL, a signal handler was not posted for this signal. This could be due to lack of memory or the signal being disabled by the signal_regime run-time tunable.
  • Refer to cobsignal.h for the definition of PFI_SIG, which defines the additional information that is passed to your handler.

Equivalent COBOL Syntax:

None.