Can you give me the gitlog output and makefile for this C program. The program file is called mathwait.c #include

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Can you give me the gitlog output and makefile for this C program. The program file is called mathwait.c #include

Post by answerhappygod »

Can you give me the gitlog output and makefile for this C
program. The program file is called mathwait.c
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
printf("I am: %d\n", (int) getpid());
pid_t pid = fork();
printf("fork returned: %d\n", (int) pid);
if (pid < 0) {
perror("Fork failed");
}
if (pid == 0) {
printf("Child process with pid: %d\n", (int) getpid());
printf("Child process is exiting\n");
exit(0);
}
printf("Parent process waiting for the child process to
end\n");
wait(NULL);
printf("parent process is exiting\n");
return(0);
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply