FreeBSD/lib/libprocstat/common_kvm.c
/*
 * Read the cdev structure in the kernel in order to work out the
 * associated dev_t
 */
Read the cdev structure in the kernel in order to work out the
associated dev_t
Read the cdev structure in the kernel in order to work out the associated dev_t
dev_t
dev2udev(kvm_t *kd, struct cdev *dev)
{
	struct cdev_priv priv;
	assert(kd);
	if (kvm_read_all(kd, (unsigned long)cdev2priv(dev), &priv,
	    sizeof(priv))) {
		return ((dev_t)priv.cdp_inode);
	} else {
		warnx("can't convert cdev *%p to a dev_t\n", dev);
		return (-1);
	}
}
dev_t dev2udev ( kvm_t * kd , struct cdev * dev ) { struct cdev_priv priv ; assert ( kd ) ; if ( kvm_read_all ( kd , ( unsigned long ) cdev2priv ( dev ) , & priv , sizeof ( priv ) ) ) { return ( ( dev_t ) priv . cdp_inode ) ; } else { warnx ( " \n " , dev ) ; return ( -1 ) ; } }
Read the cdev structure in the kernel in order to work out the
 associated dev_t
Read the cdev structure in the kernel in order to work out the associated dev_t