diff options
author | delphij <delphij@FreeBSD.org> | 2015-07-15 19:21:26 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-07-15 19:21:26 +0000 |
commit | 2a25cee78ab1d37e7d2bc40ae675646974d99f56 (patch) | |
tree | b0302ac4be59e104f4e1e54014561a1389397192 /contrib/ntp/include/iosignal.h | |
parent | a0741a75537b2e0514472ac3b28afc55a7846c30 (diff) | |
download | FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.zip FreeBSD-src-2a25cee78ab1d37e7d2bc40ae675646974d99f56.tar.gz |
MFC r280849,280915-280916,281015-281016,282097,282408,282415,283542,
284864,285169-285170,285435:
ntp 4.2.8p3.
Relnotes: yes
Approved by: re (?)
Diffstat (limited to 'contrib/ntp/include/iosignal.h')
-rw-r--r-- | contrib/ntp/include/iosignal.h | 63 |
1 files changed, 49 insertions, 14 deletions
diff --git a/contrib/ntp/include/iosignal.h b/contrib/ntp/include/iosignal.h index bd74e09..406804e 100644 --- a/contrib/ntp/include/iosignal.h +++ b/contrib/ntp/include/iosignal.h @@ -1,23 +1,58 @@ -#if !defined _ntp_iosignaled_h -#define _ntp_iosignaled_h +#ifndef IOSIGNAL_H +#define IOSIGNAL_H #include "ntp_refclock.h" + /* + * Some systems (MOST) define SIGPOLL == SIGIO, others SIGIO == SIGPOLL, and + * a few have separate SIGIO and SIGPOLL signals. This code checks for the + * SIGIO == SIGPOLL case at compile time. + * Do not define USE_SIGPOLL or USE_SIGIO. + * these are interal only to iosignal.c and ntpd/work_fork.c! + */ +#if defined(USE_SIGPOLL) +# undef USE_SIGPOLL +#endif +#if defined(USE_SIGIO) +# undef USE_SIGIO +#endif + +/* type of input handler function - only shared between iosignal.c and ntp_io.c */ +typedef void (input_handler_t)(l_fp *); + #if defined(HAVE_SIGNALED_IO) -extern void block_sigio P((void)); -extern void unblock_sigio P((void)); -extern int init_clock_sig P((struct refclockio *)); -extern void init_socket_sig P((int)); -extern void set_signal P((void)); -RETSIGTYPE sigio_handler P((int)); +# if defined(USE_TTY_SIGPOLL) || defined(USE_UDP_SIGPOLL) +# define USE_SIGPOLL +# endif -# define BLOCKIO() ((void) block_sigio()) -# define UNBLOCKIO() ((void) unblock_sigio()) +# if !defined(USE_TTY_SIGPOLL) || !defined(USE_UDP_SIGPOLL) +# define USE_SIGIO +# endif -#else +# if defined(USE_SIGIO) && defined(USE_SIGPOLL) +# if SIGIO == SIGPOLL +# define USE_SIGIO +# undef USE_SIGPOLL +# endif /* SIGIO == SIGPOLL */ +# endif /* USE_SIGIO && USE_SIGPOLL */ -# define BLOCKIO() -# define UNBLOCKIO() -#endif /* HAVE_SIGNALED_IO */ +#define USING_SIGIO() using_sigio +extern int using_sigio; + +extern void block_sigio (void); +extern void unblock_sigio (void); +extern int init_clock_sig (struct refclockio *); +extern void init_socket_sig (int); +extern void set_signal (input_handler_t *); + +# define BLOCKIO() block_sigio() +# define UNBLOCKIO() unblock_sigio() + +#else /* !HAVE_SIGNALED_IO follows */ +# define BLOCKIO() do {} while (0) +# define UNBLOCKIO() do {} while (0) +# define USING_SIGIO() FALSE #endif + +#endif /* IOSIGNAL_H */ |