a)What, to whom and how many values a fork system call returns? b)Assuming there is no syntax
Fantastic news! We've Found the answer you've been seeking!
Question:
a)What, to whom and how many values a fork system call returns?
b)Assuming there is no syntax error, what is the output for the following C program for linux? All of you may need to put screenshot of your PC in which Terminal login must be your arid number.
int main()
{ pid_t fork_return;
fork_return = fork();
if (fork_return == 0) {
execlp("/bin/ls", "ls", NULL);
printf("Child process ID: %d", getpid());
exit(0);
}
else { wait (NULL);
printf("Parent process ID: %d", getpid());
}
return 0;
}
Related Book For
Posted Date: