]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MINICERN/packlib/kernlib/kerngen/ccgen/sigbsd.c
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / MINICERN / packlib / kernlib / kerngen / ccgen / sigbsd.c
1 /*
2  * $Id$
3  *
4  * $Log$
5  * Revision 1.2  1997/02/04 17:34:40  mclareni
6  * Merge Winnt and 97a versions
7  *
8  * Revision 1.1.1.1.2.1  1997/01/21 11:29:41  mclareni
9  * All mods for Winnt 96a on winnt branch
10  *
11  * Revision 1.1.1.1  1996/02/15 17:49:26  mclareni
12  * Kernlib
13  *
14  */
15 /*>    ROUTINE SIGNALF
16   CERN PROGLIB#         SIGNALF         .VERSION KERNFOR  4.36  930602
17   ORIG. 24/05/93, JZ
18   FORTRAN interface routine to sigvec    */
19 #include <signal.h>
20 #include "kerngen/fortranc.h"
21
22 #if defined(CERNLIB_QX_SC)
23 int type_of_call signalf_(signum,funct,flag)
24 #endif
25 #if defined(CERNLIB_QXNO_SC)
26 int type_of_call signalf(signum,funct,flag)
27 #endif
28 #if defined(CERNLIB_QXCAPT)
29 int type_of_call SIGNALF(signum,funct,flag)
30 #endif
31       int  *signum, *flag;
32       void (*funct)();
33 {
34       int  istat, signo;
35
36       struct sigvec newbuf;
37       struct sigvec oldbuf;
38
39       signo = *signum;
40
41       if        (*flag < 0)    newbuf.sv_handler = funct;
42         else if (*flag == 0)   newbuf.sv_handler = SIG_DFL;
43         else if (*flag == 1)   newbuf.sv_handler = SIG_IGN;
44         else                   newbuf.sv_handler = (void (*)())*flag;
45
46       newbuf.sv_flags = 0;
47       newbuf.sv_mask  = 0;
48
49       istat = sigvec(signo,&newbuf,&oldbuf);
50       if (istat == 0)        return (int)oldbuf.sv_handler;
51       return -1;
52 }
53 /*> END <----------------------------------------------------------*/