FreeBSD/contrib/ntp/ntpd/ntp_io.c
/*
 * io_addclock - add a reference clock to the list and arrange that we
 *				 get SIGIO interrupts from it.
 */
add a reference clock to the list and arrange that we
get SIGIO interrupts from it.
add a reference clock to the list and arrange that we get SIGIO interrupts from it .
int
io_addclock(
	struct refclockio *rio
	)
{
	BLOCKIO();
	rio->active = TRUE;
# ifdef HAVE_SIGNALED_IO
	if (init_clock_sig(rio)) {
		UNBLOCKIO();
		return 0;
	}
# elif defined(HAVE_IO_COMPLETION_PORT)
	if (!io_completion_port_add_clock_io(rio)) {
		UNBLOCKIO();
		return 0;
	}
# endif
	LINK_SLIST(refio, rio, next);
	add_fd_to_list(rio->fd, FD_TYPE_FILE);
	UNBLOCKIO();
	return 1;
}
int io_addclock ( struct refclockio * rio ) { BLOCKIO ( ) ; rio -> active = TRUE ; # ifdef HAVE_SIGNALED_IO if ( init_clock_sig ( rio ) ) { UNBLOCKIO ( ) ; return 0 ; } # elif defined ( HAVE_IO_COMPLETION_PORT ) if ( ! io_completion_port_add_clock_io ( rio ) ) { UNBLOCKIO ( ) ; return 0 ; } # endif LINK_SLIST ( refio , rio , next ) ; add_fd_to_list ( rio -> fd , FD_TYPE_FILE ) ; UNBLOCKIO ( ) ; return 1 ; }
io_addclock - add a reference clock to the list and arrange that we
                               get SIGIO interrupts from it.
io_addclock - add a reference clock to the list and arrange that we get SIGIO interrupts from it .
/*
	 * Stuff the I/O structure in the list and mark the descriptor
	 * in use.  There is a harmless (I hope) race condition here.
	 */ /*
	 * enqueue
	 */ /*
	 * register fd
	 */