Question

Questions: 1) Write a simple program to create three processes using fork() commands. Use any three...

Questions:

1) Write a simple program to create three processes using fork() commands. Use any three of the six system calls to show how each child process executes new sub-programs using exec’s minions. Show the output of each of the child process with different data samples.  

2) Write a simple program in your Linux environment using C++ to identify PID, PPID and GID for the processes created in Question 1 and display the real and effective user ID.  

3) Modify the program you wrote for Question 1 and include the alarm system call to kill one of the processes that you had created in 30 second.

Thank You in Advance.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Questions: 1) Write a simple program to create three processes using fork() commands. Use any three...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 (a) Describe the five IP addressing classes. Provide an example for each of classes...

    Question 1 (a) Describe the five IP addressing classes. Provide an example for each of classes in binary and dotted-decimal representation. (b) Show the conversion of each of the addresses. (c) Describe the function of the subnet address for each of the classes and how does it work. [20 Marks] Question 2 (a) Define message switching, circuit switching and packet switching. Draw a diagram for each method to show the difference between them. (b) Identify the samples of network environment...

  • Using either a UNIX or a Linux system, write a C program that forks a child...

    Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. Process states can be obtained from the command: ps -l The process states are shown below the S column; processes with a state of Z are zombies. The process identifier (pid) of the child process is listed in the PID column, and that of the parent is listed in the PPID column. Because you do not want...

  • I will provide, best rating. Please help me out understand how to solve part 2 of...

    I will provide, best rating. Please help me out understand how to solve part 2 of this problem. I'm not sure how to make this work using ONLY the exec-family. No system() function call. 1. Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. This zombie process must remain in the system for at least 10 seconds. Process states can be obtained from the command: ps...

  • In this assignment you will be working with processes on the Linux platform. You will be...

    In this assignment you will be working with processes on the Linux platform. You will be programming in C or CH. Partl. Writhe a program prog that repeatedly creates a sub-process using fork(). And wait()s until it terminates. In particular, each child process displays "Child Running and calls exito immediately. Part2. Modify prog so that each child process spawns another program b using execve(). The program b, execute the kernel command Is and immediately exits.

  • LINUX! In shell scripting if possible and show commands (please do not copy codes form others)...

    LINUX! In shell scripting if possible and show commands (please do not copy codes form others) Thank you! Write a simple test program to find out PIDs of ALL ancestor (i.e., parent, grandparent ) processes of the current process or a given process specified by a PID. A parent process's PID of a given process pid can be found in /proc/$pid/status

  • Answer this question Properly Please find out how many processes and how many threads are created:...

    Answer this question Properly Please find out how many processes and how many threads are created:                              pid_t pid;             pid = fork();             if (pid == 0) { /* child process */                   fork();                   thread_create(...); } fork(); a) Write working codes from the pseudo-code above. Add appropriate codes to ensure that you have time to observe processes and threads using ‘top’ and ‘H’ keystroke. b) Draw a simple diagram showing the processes and threads in their parent/child...

  • For Linux Operating System: Write a simple test program in C to find out PIDs of...

    For Linux Operating System: Write a simple test program in C to find out PIDs of ALL ancestor (i.e., parent, grandparent ) processes of the current process or a given process specified by a PID. A parent process's PID of a given process pid can be found in /proc/$pid/status

  • Write a C program for Linux called pipes.c that does the following: In the main() function,...

    Write a C program for Linux called pipes.c that does the following: In the main() function, it creates a pipe using the pipe() function, then creates two child processes with fork(). Child 1 redirects stdout to the write end of the pipe and then executes with execlp() the "ps -aux" command. Child 2 redirects its input from stdin to the read end of the pipe, then it executes the "sort -r -n -k 5" command. After creating both children, the...

  • C program To develop a C program to implement a process system call. PROBLEM You are...

    C program To develop a C program to implement a process system call. PROBLEM You are to use the Ubuntu operating system to write a C program that creates a process to determine the identification of the current user of your computer. I mean if joe is the login of the current user of your computer your solution should return joe. Your solution must also provide the pid of both the parent and the child processes. You may use the...

  • Source code to modify: #include <stdio.h> #include <unistd.h> #include <sys/types.h> int main() { pid_t pid; /*fork...

    Source code to modify: #include <stdio.h> #include <unistd.h> #include <sys/types.h> int main() { pid_t pid; /*fork a child process*/ pid = fork(); if (pid<0){ /*error occured*/ fprintf(stderr,"Fork failed\n"); return 1; } else if (pid == 0) { /*child process */ printf("I am the child %d\n",pid); execlp("/bin/ls","ls",NULL); } else { /*parent process */ /*parent will wait for the child to complete*/ printf("I am the parent %d\n",pid); wait(NULL); printf("Child Complete\n"); } return 0; } 1. Write program codes for 3.21 a and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT