/*  This file is part of lsnet. 

    Lsnet is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Lsnet is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with lsnet.  If not, see <http://www.gnu.org/licenses/>.
*/

//#include <sys/types.h>
//#include <dirent.h>
//#define SIZE2 10000

int processes() {
	DIR *dp;
	struct dirent *ep;
	dp = (opendir ("/proc"));
	int processes = 0;
	while ((ep = readdir (dp))){
		if (ep->d_name[0] == '0' || ep->d_name[0] == '1' || ep->d_name[0] == '2' || ep->d_name[0] == '3' || ep->d_name[0] == '4' || ep->d_name[0] == '5' || ep->d_name[0] == '6' || ep->d_name[0] == '7' || ep->d_name[0] == '8' ||ep->d_name[0] == '9'){  
                       	processes++;
 		}
	}
		(void) closedir (dp);
	return (processes);
}

