dacs_errhandler_reg

NAME

dacs_errhandler_reg - Register an error handler to be called when an asynchronous or fatal error occurs.

SYNOPSIS

DACS_ERR_T dacs_errhandler_reg ( dacs_error_handler_t handler, uint32_t flags )

Call parameters  
handler A pointer to an error handling function. This function will be passed the error object containing the error information, and returns a boolean indicating whether termination is requested or not. For fatal internal errors the process will be terminated without consideration for the handler's return value.
flags Flags for error handling options.
Note: In SDK 3.0 no flags are supported; the flags value passed in must be 0 (zero).

The prototype of the handler is:

int (*dacs_error_handler_t)( dacs_error_t error )

The user-registered handler must accept a handle to an error object, and return 1 (one) or 0 (zero) to indicate whether the error is deemed fatal or not.

DESCRIPTION

The dacs_errhandler_reg service registers an error handler. This handler will then be called whenever an asynchronous DaCS process fails, or a synchronous DaCS process encounters a fatal error.
Note: In SDK 3.0 the return value from the user handler will be ignored in all cases.
Note: If the error handler is coded in the form
int my_errhandler(dacs_error_t error)
then write the registration as
dacs_rc=dacs_errhandler_reg((dacs_error_handler_t)&my_errhandler,0);
where dacs_rc has been declared as a variable of type DACS_ERROR_T.

RETURN VALUE

The dacs_errhandler_reg service returns an error indicator defined as:
  • DACS_SUCCESS: normal return.
  • DACS_ERR_INVALID_ADDR: the pointer is invalid.
  • DACS_ERR_INVALID_ATTR: the flag or enumerated constant is invalid.
  • DACS_ERR_NO_RESOURCE: unable to allocate required resources.

SEE ALSO

dacs_strerror(3), dacs_error_num(3), dacs_error_code(3), dacs_error_str(3), dacs_error_de(3), dacs_error_pid(3)