/* Makes system load climb himalaya, whithout hurting (too much) other
processes */
/* by Lucas Nussbaum <lucas@lucas-nussbaum.net> */
/* This is public domain software */

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <unistd.h>

/* child processes to create, this should be egal to load increase */
#define NBPROCESS 10

int main()
{
	int i, n;
	for (i=0; i<NBPROCESS; i++) /* for each process */
	{
		if ((n = fork())==-1)
		{
			printf("Fork failed!\n");
			exit(-1);
		}
		else if (n == 0)
		{
			/* child process */
			setpriority(PRIO_PROCESS, getpid(),20); /* lower
priority */
			for (;;); /* infinite loop */
 		}
	}
	exit(0);
}
