HP MLIB User's Guide Vol. 2 7th Ed.

Appendix A 1095
Error handling
Figure A-5 illustrates the use of initMLIB, whose function prototype is obtained
from veclib.h.
Figure A-5 Changing the VECLIB error handling signal
% cat vsig2.c
#include <signal.h>
#include <veclib.h>
main ()
{
int n = 1;
float alpha = 0.0;
float x[10];
int incx = 0;
initMLIB (SIGUSR1);
sflr1c (&n, &alpha, x, &incx);
printf("Hello world\n");
}
% cc vsig2.c -lveclib
% a.out
****************************************************************************
* XERVEC: subprogram SFLR1C called with invalid value of argument number 4 *
****************************************************************************
% echo $status
1
In Figure A-5, the call to initMLIB changes VECLIB’s error handling signal to
SIGUSR1 and enables VECLIB’s simple signal handler for this signal. If 0 or
SIGIOT had been used in place of SIGUSR1, the only differences in behavior
from the program in Figure A-5 would be the core image and the exit status.
NOTE The initialization function for LAPACK also is called initMLIB.
Any previously established signal handler for signal sig is replaced by
VECLIB’s default signal handler.