int     unit, part, size;
int part, size;
xdsize(dev)	dev_t   dev;{	struct xd_softc *xdsc;	int     unit, part, size;	/* valid unit?  try an open */	if (xdopen(dev, 0, S_IFBLK) != 0)		return (-1);	/* do it */	xdsc = xd_cd.cd_devs[DISKUNIT(dev)];	part = DISKPART(dev);	if (xdsc->sc_dk.dk_label->d_partitions[part].p_fstype != FS_SWAP)		size = -1;	/* only give valid size for swap partitions */	else		size = xdsc->sc_dk.dk_label->d_partitions[part].p_size;	if (xdclose(dev, 0, S_IFBLK) != 0)		return -1;	return size;}