FreeBSD/usr.bin/systat/vmstat.c
/* calculate number of users on the system */
calculate number of users on the system
calculate number of users on the system
static int
ucount(void)
{
	int nusers = 0;
	struct utmpx *ut;
	setutxent();
	while ((ut = getutxent()) != NULL)
		if (ut->ut_type == USER_PROCESS)
			nusers++;
	endutxent();
	return (nusers);
}
static int ucount ( void ) { int nusers = 0 ; struct utmpx * ut ; setutxent ( ) ; while ( ( ut = getutxent ( ) ) != NULL ) if ( ut -> ut_type == USER_PROCESS ) nusers ++ ; endutxent ( ) ; return ( nusers ) ; }
calculate number of users on the system
calculate number of users on the system