02-17-2003
23,
0
Join Date: Jan 2002
Last Activity: 24 February 2003, 8:48 AM EST
Location: uk
Posts: 23
Thanks Given: 0
Thanked 0 Times in 0 Posts
could some assist please
i was searching on the net have found a couple of sample programs and was wondering if some could tell me what they do cheers.
main()
{
printf("Executing ls\n");
execl("/bin/ls","ls","-l", (char *)0);
perror("execl failed to run ls");
exit(1);
}
main()
{
int i;
i = fork();
if (i == 0)
{
printf("Child. getpid() = %d, getppid() = %d\n", getpid(), getppid());
sleep(5);
printf("After sleeping. getpid() = %d, getppid() = %d\n",
getpid(), getppid());
}
else
{
printf("Parent exiting now\n");
}
}
thanks in advance guys