signal now deals with void functions
This commit is contained in:
parent
2309d12210
commit
82f89c97a6
|
@ -17,6 +17,7 @@ int nr;
|
||||||
/*debug printf("trap set to %d\n",nr);*/
|
/*debug printf("trap set to %d\n",nr);*/
|
||||||
_trpline=nr;
|
_trpline=nr;
|
||||||
}
|
}
|
||||||
|
void
|
||||||
_trpfatal(i)
|
_trpfatal(i)
|
||||||
int i;
|
int i;
|
||||||
{
|
{
|
||||||
|
@ -35,7 +36,7 @@ int i;
|
||||||
_ini_trp()
|
_ini_trp()
|
||||||
{
|
{
|
||||||
/* initialize trap routines */
|
/* initialize trap routines */
|
||||||
int i, _trpfatal();
|
int i;
|
||||||
|
|
||||||
for(i=0;i<NSIG;i++)
|
for(i=0;i<NSIG;i++)
|
||||||
signal(i,_trpfatal);
|
signal(i,_trpfatal);
|
||||||
|
|
|
@ -8,7 +8,7 @@ DEFINITION MODULE Unix;
|
||||||
FROM SYSTEM IMPORT WORD, ADDRESS;
|
FROM SYSTEM IMPORT WORD, ADDRESS;
|
||||||
|
|
||||||
(* Type needed for Signal *)
|
(* Type needed for Signal *)
|
||||||
TYPE SignalPrc = PROCEDURE(INTEGER):INTEGER;
|
TYPE SignalPrc = PROCEDURE(INTEGER);
|
||||||
CONST
|
CONST
|
||||||
SIGDFL = SignalPrc(NIL);
|
SIGDFL = SignalPrc(NIL);
|
||||||
SIGIGN = SignalPrc(NIL+1);
|
SIGIGN = SignalPrc(NIL+1);
|
||||||
|
@ -99,8 +99,7 @@ DEFINITION MODULE Unix;
|
||||||
PROCEDURE setuid(uid: INTEGER) : INTEGER;
|
PROCEDURE setuid(uid: INTEGER) : INTEGER;
|
||||||
PROCEDURE setgid(gid: INTEGER) : INTEGER;
|
PROCEDURE setgid(gid: INTEGER) : INTEGER;
|
||||||
PROCEDURE signal(sig: INTEGER;
|
PROCEDURE signal(sig: INTEGER;
|
||||||
func: SignalPrc;
|
func: SignalPrc) : SignalPrc;
|
||||||
VAR oldfunc: SignalPrc) : INTEGER;
|
|
||||||
PROCEDURE sigtrp(trapno, signo: INTEGER) : INTEGER;
|
PROCEDURE sigtrp(trapno, signo: INTEGER) : INTEGER;
|
||||||
(* Let Unix signal signo cause EM trap trapno to occur *)
|
(* Let Unix signal signo cause EM trap trapno to occur *)
|
||||||
PROCEDURE stat(path: ADDRESS; statbuf: ADDRESS) : INTEGER;
|
PROCEDURE stat(path: ADDRESS; statbuf: ADDRESS) : INTEGER;
|
||||||
|
|
|
@ -25,7 +25,7 @@ static int __traps[] = {
|
||||||
-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
|
-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static void
|
||||||
__ctchsig(signo)
|
__ctchsig(signo)
|
||||||
{
|
{
|
||||||
signal(signo,__ctchsig);
|
signal(signo,__ctchsig);
|
||||||
|
@ -47,8 +47,8 @@ sigtrp(trapno, signo)
|
||||||
indicates failure, with error number in errno.
|
indicates failure, with error number in errno.
|
||||||
*/
|
*/
|
||||||
extern int errno;
|
extern int errno;
|
||||||
int (*ctch)() = __ctchsig;
|
void (*ctch)() = __ctchsig;
|
||||||
int (*oldctch)();
|
void (*oldctch)();
|
||||||
int oldtrap;
|
int oldtrap;
|
||||||
|
|
||||||
if (signo <= 0 || signo >= sizeof(__traps)/sizeof(__traps[0])) {
|
if (signo <= 0 || signo >= sizeof(__traps)/sizeof(__traps[0])) {
|
||||||
|
@ -69,7 +69,7 @@ sigtrp(trapno, signo)
|
||||||
|
|
||||||
oldtrap = __traps[signo];
|
oldtrap = __traps[signo];
|
||||||
|
|
||||||
if ((oldctch = signal(signo, ctch)) == (int (*)())-1) /* errno set by signal */
|
if ((oldctch = signal(signo, ctch)) == (void (*)())-1) /* errno set by signal */
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
else if (oldctch == SIG_IGN) {
|
else if (oldctch == SIG_IGN) {
|
||||||
|
|
Loading…
Reference in a new issue