1
0
mirror of https://github.com/PDP-10/klh10.git synced 2026-02-10 10:11:08 +00:00

Replace CENV_SYSF_SIGSET with HAVE_SIGACTION

This commit is contained in:
Olaf Seibert
2016-01-21 21:19:46 +01:00
parent e3e86227de
commit d0f53b8cc9
6 changed files with 13 additions and 14 deletions

View File

@@ -222,10 +222,6 @@
#ifndef CENV_SYSF_BSDTTY /* Has old BSD tty stuff */
# define CENV_SYSF_BSDTTY (!CENV_SYSF_TERMIOS && CENV_SYS_BSD)
#endif
#ifndef CENV_SYSF_SIGSET /* Has sigsetops(3) and sigaction(2) */
# define CENV_SYSF_SIGSET (CENV_SYS_DECOSF|CENV_SYS_SUN|CENV_SYS_SOLARIS \
|CENV_SYS_XBSD|CENV_SYS_LINUX)
#endif
/* Large File Support (LFS)
* See <http://ftp.sas.com/standards/large.file/x_open.20Mar96.html>

View File

@@ -696,7 +696,7 @@ dp_strerror(int err)
static int
dp_signal(int sig, void (*func)(int))
{
#if CENV_SYSF_SIGSET
#if HAVE_SIGACTION
struct sigaction act, oact;
act.sa_handler = func;
@@ -730,7 +730,7 @@ dp_sleep(int secs)
#if CENV_SYS_DECOSF
sleep(secs); /* Independent of interval timers! */
#elif HAVE_SETITIMER && CENV_SYSF_SIGSET
#elif HAVE_SETITIMER && HAVE_SIGACTION
/* Must save & restore ITIMER_REAL & SIGALRM, which conflict w/sleep() */
struct itimerval ztm, otm;
struct sigaction act, oact;

View File

@@ -67,6 +67,8 @@
# if HAVE_SETITIMER
# include <sys/time.h> /* BSD: For setitimer() */
# endif
# if HAVE_GETRUSAGE
# include <sys/resource.h> /* BSD: For getrusage() */
# endif
@@ -1127,7 +1129,7 @@ os_vtimer(ossighandler_t *irtn, uint32 usecs)
void
os_timer_restore(ostimer_t *ostate)
{
#if HAVE_SETITIMER && CENV_SYSF_SIGSET
#if HAVE_SETITIMER && HAVE_SIGACTION
sigset_t blkset, savset;
int ret;
@@ -1161,7 +1163,7 @@ os_timer_restore(ostimer_t *ostate)
void
os_v2rt_idle(ossighandler_t *hdlarg)
{
#if HAVE_SETITIMER && CENV_SYSF_SIGSET
#if HAVE_SETITIMER && HAVE_SIGACTION
sigset_t allmsk, oldmsk, nomsk;
struct itimerval ntval, vtval;
static ossighandler_t *handler = NULL;
@@ -1523,7 +1525,7 @@ osux_signal(int sig, ossighandler_t *func)
int
osux_sigact(int sig, ossighandler_t *func, ossigact_t *ossa)
{
#if CENV_SYSF_SIGSET
#if HAVE_SIGACTION
struct sigaction act;
act.sa_handler = func;
@@ -1550,7 +1552,7 @@ osux_sigact(int sig, ossighandler_t *func, ossigact_t *ossa)
int
osux_sigrestore(ossigact_t *ossa)
{
#if CENV_SYSF_SIGSET
#if HAVE_SIGACTION
return sigaction(ossa->ossa_sig,
&ossa->ossa_sa, (struct sigaction *)NULL);
#elif CENV_SYS_BSD

View File

@@ -106,7 +106,8 @@ typedef void ossighandler_t(int);
# define SIG_ERR ((ossighandler_t *)-1)
#endif
#if CENV_SYSF_SIGSET
/* HAVE_SIGACTION pretty much implies the sigemptyset functions/macros */
#if HAVE_SIGACTION
# define ossigset_t sigset_t
# define os_sigemptyset(set) sigemptyset(set)
# define os_sigfillset(set) sigfillset(set)
@@ -133,7 +134,7 @@ typedef void ossighandler_t(int);
typedef struct {
int ossa_sig;
#if CENV_SYSF_SIGSET
#if HAVE_SIGACTION
struct sigaction ossa_sa;
#else
ossighandler_t *ossa_handler;