FreeBSD/contrib/ntp/ntpd/ntp_io.c
/*
 * create new interface structure initialize from
 * template structure or via standard initialization
 * function
 */
create new interface structure initialize from
template structure or via standard initialization
function
create new interface structure initialize from template structure or via standard initialization function
static struct interface *
new_interface(
	struct interface *interface
	)
{
	struct interface *	iface;
	iface = emalloc(sizeof(*iface));
	if (NULL == interface)
		init_interface(iface);
	else				
		memcpy(iface, interface, sizeof(*iface));
	iface->ifnum = sys_ifnum++;
	iface->starttime = current_time;
#   ifdef HAVE_IO_COMPLETION_PORT
	if (!io_completion_port_add_interface(iface)) {
		msyslog(LOG_EMERG, "cannot register interface with IO engine -- will exit now");
		exit(1);
	}
#   endif
	return iface;
}
static struct interface * new_interface ( struct interface * interface ) { struct interface * iface ; iface = emalloc ( sizeof ( * iface ) ) ; if ( NULL == interface ) init_interface ( iface ) ; else memcpy ( iface , interface , sizeof ( * iface ) ) ; iface -> ifnum = sys_ifnum ++ ; iface -> starttime = current_time ; #   ifdef HAVE_IO_COMPLETION_PORT if ( ! io_completion_port_add_interface ( iface ) ) { msyslog ( LOG_EMERG , " " ) ; exit ( 1 ) ; } #   endif return iface ; }
create new interface structure initialize from
 template structure or via standard initialization
 function
create new interface structure initialize from template structure or via standard initialization function
/* use the template */ /* count every new instance of an interface in the system */