Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question # 1: Implementing print-kernel-release() [20 pts] When the user types '1',the print_kernel_release() function prints the kernel version as follows: 1. See the kernel release
Question # 1: Implementing print-kernel-release() [20 pts] When the user types '1',the print_kernel_release() function prints the kernel version as follows: 1. See the kernel release 2. See the number of cores 3. See the RAM capacity 4. Exit I user types'1' 4.4.0-103-generic The output above is simply the output of the uname command with particular command-line arguments (read the man page to find out which ones) Rather than re-implementing uname to generate this output (which would be painful), implement print_kernel_release() by: Starting a child process Having that child process exec the uname program with the right arguments Wait for the child process to complete . Here are a few hints: There is a whole family of exec system calls (do a man exec and really read the man page). You can use whichever exec you want, but some are more convenient than others. Note that in your real Linux Shell, you can find out the path to any command by typing which and then the command. For instance "which 1s" will tell you where the 1s executable is stored on the file system. Providing full path to exec is typically necessary
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