11 #include "ntp_syslog.h"
12 #include "ntp_stdlib.h"
18 #if defined(__STDC__) || defined(HAVE_STDARG_H)
25 #if defined(__STDC__) || defined(HAVE_STDARG_H)
28 void (*func
) P((int));
34 vec
.sa_handler
= func
;
35 sigemptyset(&vec
.sa_mask
);
38 vec
.sa_flags
= SA_RESTART
;
47 /* Added for PPS clocks on Solaris 7 which get EINTR errors */
49 if (sig
== SIGPOLL
) vec
.sa_flags
= SA_RESTART
;
52 if (sig
== SIGIO
) vec
.sa_flags
= SA_RESTART
;
58 struct sigaction ovec
;
60 n
= sigaction(sig
, &vec
, &ovec
);
61 if (n
== -1 && errno
== EINTR
) continue;
64 && ovec
.sa_flags
!= SA_RESTART
67 msyslog(LOG_DEBUG
, "signal_no_reset: signal %d had flags %x",
82 RETSIGTYPE (*func
) (int)
88 bzero((char *) &sv
, sizeof(sv
));
90 n
= sigvec(sig
, &sv
, (struct sigvec
*)NULL
);
102 RETSIGTYPE (*func
) (int)
107 n
= sigset(sig
, func
);
116 /* Beware! This implementation resets the signal to SIG_DFL */
120 RETSIGTYPE (*func
) (int)
124 if (SIG_ERR
== signal(sig
, func
)) {
127 n
= signal(sig
, func
);