sprintf(*bufp, "%u\n", physmem - uvmexp.wired);
sprintf(*bufp, "%u\n", ctob(physmem - uvmexp.wired));
kernfs_xread(kt, off, bufp, len)	struct kern_target *kt;	int off;	char **bufp;	int len;{	switch (kt->kt_tag) {	case KTT_TIME: {		struct timeval tv;		microtime(&tv);		sprintf(*bufp, "%ld %ld\n", tv.tv_sec, tv.tv_usec);		break;	}	case KTT_INT: {		int *ip = kt->kt_data;		sprintf(*bufp, "%d\n", *ip);		break;	}	case KTT_STRING: {		char *cp = kt->kt_data;		*bufp = cp;		break;	}	case KTT_MSGBUF: {		extern struct msgbuf *msgbufp;		long n;		if (msgbufp == NULL || msgbufp->msg_magic != MSG_MAGIC)			return (ENXIO);		/*		 * Note that reads of /kern/msgbuf won't necessarily yield		 * consistent results, if the message buffer is modified		 * while the read is in progress.  The worst that can happen		 * is that incorrect data will be read.  There's no way		 * that this can crash the system unless the values in the		 * message buffer header are corrupted, but that'll cause		 * the system to die anyway.		 */		if (msgbufp->msg_bufl < msgbufp->msg_bufs) {			if (off >= msgbufp->msg_bufx)				return (0);			n = off;			len = msgbufp->msg_bufx - n;		} else {			if (off >= msgbufp->msg_bufs)				return (0);			n = msgbufp->msg_bufx + off;			if (n >= msgbufp->msg_bufs)				n -= msgbufp->msg_bufs;			len = min(msgbufp->msg_bufs - n, msgbufp->msg_bufs - off);		}		*bufp = msgbufp->msg_bufc + n;		return (len);	}	case KTT_HOSTNAME: {		char *cp = hostname;		int xlen = hostnamelen;		if (xlen >= (len-2))			return (EINVAL);		bcopy(cp, *bufp, xlen);		(*bufp)[xlen] = '\n';		(*bufp)[xlen+1] = '\0';		break;	}	case KTT_DOMAIN: {		char *cp = domainname;		int xlen = domainnamelen;		if (xlen >= (len-2))			return (EINVAL);		bcopy(cp, *bufp, xlen);		(*bufp)[xlen] = '\n';		(*bufp)[xlen+1] = '\0';		break;	}	case KTT_AVENRUN:		averunnable.fscale = FSCALE;		sprintf(*bufp, "%d %d %d %ld\n",		    averunnable.ldavg[0], averunnable.ldavg[1],		    averunnable.ldavg[2], averunnable.fscale);		break;	case KTT_USERMEM:		sprintf(*bufp, "%u\n", physmem - uvmexp.wired);		break;#ifdef IPSEC	case KTT_IPSECSPI:		return(ipsp_kern(off, bufp, len));#endif	default:		return (0);	}	len = strlen(*bufp);	if (len <= off)		return (0);	*bufp += off;	return (len - off);}