network/uinet/sys/kern/kern_cons.c
/* add a new physical console to back the virtual console */
add a new physical console to back the virtual console
add a new physical console to back the virtual console
int
cnadd(struct consdev *cn)
{
	struct cn_device *cnd;
	int i;
	STAILQ_FOREACH(cnd, &cn_devlist, cnd_next)
		if (cnd->cnd_cn == cn)
			return (0);
	for (i = 0; i < CNDEVTAB_SIZE; i++) {
		cnd = &cn_devtab[i];
		if (cnd->cnd_cn == NULL)
			break;
	}
	if (cnd->cnd_cn != NULL)
		return (ENOMEM);
	cnd->cnd_cn = cn;
	if (cn->cn_name[0] == '\0') {
		printf("WARNING: console at %p has no name\n", cn);
	}
	STAILQ_INSERT_TAIL(&cn_devlist, cnd, cnd_next);
	if (STAILQ_FIRST(&cn_devlist) == cnd)
		ttyconsdev_select(cnd->cnd_cn->cn_name);
	cnavailable(cn, (cn->cn_flags & CN_FLAG_NOAVAIL) == 0);
	return (0);
}
int cnadd ( struct consdev * cn ) { struct cn_device * cnd ; int i ; STAILQ_FOREACH ( cnd , & cn_devlist , cnd_next ) if ( cnd -> cnd_cn == cn ) return ( 0 ) ; for ( i = 0 ; i < CNDEVTAB_SIZE ; i ++ ) { cnd = & cn_devtab [ i ] ; if ( cnd -> cnd_cn == NULL ) break ; } if ( cnd -> cnd_cn != NULL ) return ( ENOMEM ) ; cnd -> cnd_cn = cn ; if ( cn -> cn_name [ 0 ] == ' \0 ' ) { printf ( " \n " , cn ) ; } STAILQ_INSERT_TAIL ( & cn_devlist , cnd , cnd_next ) ; if ( STAILQ_FIRST ( & cn_devlist ) == cnd ) ttyconsdev_select ( cnd -> cnd_cn -> cn_name ) ; cnavailable ( cn , ( cn -> cn_flags & CN_FLAG_NOAVAIL ) == 0 ) ; return ( 0 ) ; }
add a new physical console to back the virtual console
add a new physical console to back the virtual console
/* XXX: it is unclear if/where this print might output */ /* Add device to the active mask. */