Forking a process in 'C'

Cedric Ramsey ramsey at NCoast.ORG
Sun Sep 23 07:55:24 AEST 1990


Hello people. I wanted to fork a process in 'C' here's the program:

main ()
{
	int status;
	/* create a new process */
	if (fork() == 0)
		{
		/* overlay new process with a different program via 'exec' */
		execlp (...);
		}
	/* sleep until child has terminated */
	wait(&status);
	return (0);
}

The problem ? The program goes into an infinite loop at the wait statement.
It simply never return. What am i doing wrong ?

THankyou All !



More information about the Comp.unix.xenix.sco mailing list