mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-01 22:32:40 +00:00
Migrate to POSIX signals. (#190)
This removes SYSVSIGNALS as we're always and only using POSIX signals now. Some platform differences have been papered over. We used to only ignore SIGPIPE when using BSD signals, but we now ignore it all the time. While the SIGFPE code will now compile, it hasn't been updated to work on modern OSes fully yet as it will need to enable the correct FP exceptions.
This commit is contained in:
@@ -203,6 +203,7 @@ int fork_Unix() {
|
||||
UnixToLisp[2], /* Outgoing pipe to LISP */
|
||||
UnixPID, LispPipeIn, LispPipeOut, slot;
|
||||
pid_t pid;
|
||||
sigset_t signals;
|
||||
|
||||
char IOBuf[4];
|
||||
unsigned short tmp;
|
||||
@@ -221,18 +222,14 @@ int fork_Unix() {
|
||||
StartTime = time(0); /* Save the time, to create filenames with */
|
||||
StartTime &= 0xFFFFFF; /* as a positive number! */
|
||||
|
||||
/* interrupts need to be blocked here so subprocess won't see them */
|
||||
#ifdef SYSVSIGNALS
|
||||
sighold(SIGVTALRM);
|
||||
sighold(SIGIO);
|
||||
sighold(SIGALRM);
|
||||
sighold(SIGXFSZ);
|
||||
sighold(SIGFPE);
|
||||
#else
|
||||
sigblock(sigmask(SIGVTALRM) | sigmask(SIGIO) | sigmask(SIGALRM)
|
||||
| sigmask(SIGXFSZ)
|
||||
| sigmask(SIGFPE));
|
||||
#endif /* SYSVSIGNALS */
|
||||
/* interrupts need to be blocked here so subprocess won't see them */
|
||||
sigemptyset(&signals);
|
||||
sigaddset(&signals, SIGVTALRM);
|
||||
sigaddset(&signals, SIGIO);
|
||||
sigaddset(&signals, SIGALRM);
|
||||
sigaddset(&signals, SIGXFSZ);
|
||||
sigaddset(&signals, SIGFPE);
|
||||
sigprocmask(SIG_BLOCK, &signals, NULL);
|
||||
|
||||
if ((UnixPID = fork()) == -1) { /* Fork off small version of the emulator */
|
||||
perror("fork");
|
||||
|
||||
Reference in New Issue
Block a user