Commit 12c2864e authored by Rob Pike's avatar Rob Pike

more nearly correct interface code for signals on linux

SVN=124021
parent aeb43984
...@@ -29,8 +29,9 @@ typedef struct sigaction { ...@@ -29,8 +29,9 @@ typedef struct sigaction {
void (*sa_handler)(int32); void (*sa_handler)(int32);
void (*sa_sigaction)(int32, siginfo *, void *); void (*sa_sigaction)(int32, siginfo *, void *);
} u; /* signal handler */ } u; /* signal handler */
uint8 sa_mask[128]; /* signal mask to apply. 128? are they MORONS? */
int32 sa_flags; /* see signal options below */ int32 sa_flags; /* see signal options below */
uint8 sa_mask[2]; /* signal mask to apply. BUG: 2 is a guess */ void (*sa_restorer) (void); /* unused here; needed to return from trap? */
} sigaction; } sigaction;
void void
...@@ -62,12 +63,10 @@ initsig(void) ...@@ -62,12 +63,10 @@ initsig(void)
{ {
int32 i; int32 i;
a.u.sa_sigaction = (void*)sigtramp; a.u.sa_sigaction = (void*)sigtramp;
a.sa_flags = 1|2|4|0x10000000|0x20000000|0x40000000|0x80000000; a.sa_flags |= 0x04; /* SA_SIGINFO */
//a.sa_flags |= SA_SIGINFO;
a.sa_flags = ~0; /* BUG: why is this needed? */
for(i=0; i<sizeof(a.sa_mask); i++) for(i=0; i<sizeof(a.sa_mask); i++)
a.sa_mask[i] = 0xFF; a.sa_mask[i] = 0xFF;
//a.sa_mask[1] = (1 << (11-1));
for(i = 0; i <NSIG; i++) for(i = 0; i <NSIG; i++)
if(sigtab[i].catch){ if(sigtab[i].catch){
sys_rt_sigaction(i, &a, (void*)0, 8); sys_rt_sigaction(i, &a, (void*)0, 8);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment