Question
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
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 fork(), getpid(), getppid(), as well as any of the exec() family of system calls.
HINT
The shell command whoami returns the current user of the system.
WHAT TO SUBMIT
You are to submit to Blackboard the following:
- Your source code, as well as
- any output produced by your solution that, clearly, states the following:
- The current user of the system, and
- information about both pids of the parent and the child processes. You are to use the following format to structure your output:
- The current user is: name-of-the-user
- Parent: My pid = pid-of-parent. I created child pid = pid-of-child
- Child: My pid = pid-of-child. My parents pid = pid-of-parent
Note: In b) Parent is to indicate that the output produced was generated by the parent process. In a similar way, in c) Child indicates that the output was generated by the child process.
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