All pastes #207541 Raw Edit

Mine

public text v1 · immutable
#207541 ·published 2006-10-18 02:00 UTC
rendered paste body
int x = 0;
if (fork() == 0)
{
	execv(argv[0], argv);
	x = 1; // this is only executed if execv() fails
	exit(1);
} 
else
{
	wait (NULL);
}


// the value of x here is 0, even if execv() fails, in which case i want this value of x to be 1