Question
UNIX/C review code and write a description: /* parent1.c */ #include #include #include int main(int argc, char * argv[]){ if(fork()==0){ char *cmd[] = { mySpell,
UNIX/C review code and write a description:
/* parent1.c */ #include
Below is the original child.c file.
% more child.c #include
We compile the child.c into an executable child, % cc child.c -o child then compile the parent1.c program. % cc parent1.c If we call it without giving it any parameter, thus argc=1, the executable of parent1.c executes the child program.
=====================================================================
Questions:
1. Play with the programs as shown in this section. You may change some of the stuff, such as the time that the child process waits, to see if there is any change of the printout. 2. Find out the general format, and discuss the various usage, of those strange functions, particularly, the exec family, fork(), getpid(), and wait().?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started