diff options
author | mycroft <mycroft@NetBSD.org> | 1995-04-28 21:30:16 +0000 |
---|---|---|
committer | mycroft <mycroft@NetBSD.org> | 1995-04-28 21:30:16 +0000 |
commit | c1bde612020b106cf3db511cf4961791c206998f (patch) | |
tree | d3fb3d7f95eca2683544ae7df6c6c5adefb927ed /sail | |
parent | d3d5ba33a16a10c2f0c3389d07a6b55f98d50093 (diff) | |
download | bsdgames-darwin-c1bde612020b106cf3db511cf4961791c206998f.tar.gz bsdgames-darwin-c1bde612020b106cf3db511cf4961791c206998f.tar.zst bsdgames-darwin-c1bde612020b106cf3db511cf4961791c206998f.zip |
Use POSIX signal and tty semantics.
Diffstat (limited to 'sail')
-rw-r--r-- | sail/machdep.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sail/machdep.h b/sail/machdep.h index a6721037..087d5636 100644 --- a/sail/machdep.h +++ b/sail/machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.h,v 1.3 1995/04/22 10:37:00 cgd Exp $ */ +/* $NetBSD: machdep.h,v 1.4 1995/04/28 21:30:16 mycroft Exp $ */ /* * Copyright (c) 1983, 1993 @@ -37,12 +37,18 @@ #define TIMEOUT 300 /* Sync() timeout in seconds */ -/* for 4.2bsd machines */ -#define blockalarm() ((void) sigblock(1 << SIGALRM-1)) -#define unblockalarm() ((void) sigsetmask(sigblock(0) & ~(1 << SIGALRM-1))) - -/* for 2.9bsd machines (onyx) -typedef int void; -#define blockalarm() ((void) sighold(SIGALRM)) -#define unblockalarm() ((void) sigrelse(SIGALRM)) -*/ +/* for POSIX systems */ +#define blockalarm() \ + do { \ + sigset_t sigset; \ + sigemptyset(&sigset); \ + sigaddset(&sigset, SIGALRM); \ + sigprocmask(SIG_BLOCK, &sigset, (sigset_t *)0); \ + } while (0) +#define unblockalarm() \ + do { \ + sigset_t sigset; \ + sigemptyset(&sigset); \ + sigaddset(&sigset, SIGALRM); \ + sigprocmask(SIG_UNBLOCK, &sigset, (sigset_t *)0); \ + } while (0) |