[comp.unix.xenix.sco] Forking a process in 'C'

ramsey@NCoast.ORG (Cedric Ramsey) (09/23/90)

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 !