1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-08 01:01:18 +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:
Bruce Mitchener
2021-01-09 11:55:39 +07:00
committed by GitHub
parent c83b4879ab
commit 2dcdf14334
20 changed files with 161 additions and 293 deletions

View File

@@ -366,29 +366,28 @@ LispPTR ether_get(LispPTR args[])
LispPTR result = NIL;
#ifndef NOETHER
LispPTR MaxByteCount;
#ifndef SYSVSIGNALS
int interrupt_mask;
#endif
sigset_t signals;
MaxByteCount = 2 * (0xFFFF & args[0]); /* words to bytes */
DBPRINT(("Ether Get. "));
#ifdef SYSVSIGNALS
sighold(SIGIO);
#else
interrupt_mask = sigblock(sigmask(SIGIO)); /* turn off ENET interrupts */
#endif /* SYSVSIGNALS */
sigemptyset(&signals);
sigaddset(&signals, SIGIO);
/* turn off ENET interrupts */
sigprocmask(SIG_BLOCK, &signals, NULL);
if (ether_fd > 0 && (MaxByteCount > 0)) {
ether_buf = (u_char *)Addr68k_from_LADDR(args[1]);
ether_bsize = MaxByteCount; /* do this LAST; it enables reads */
result = get_packet();
/* check_ether(); for old behavior, move comment to above line */
}
#ifdef SYSVSIGNALS
sigrelse(SIGIO);
#else
sigsetmask(interrupt_mask); /* interrupts back on */
#endif /* SYSVISGNALS */
/* enable interrupts */
sigprocmask(SIG_UNBLOCK, &signals, NULL);
#endif /* NOETHER */
return (result);