Question: USING C LANGUAGE. I learned about /proc but im having trouble implementing this. I have this template, and am not sure how to use it

USING C LANGUAGE. I learned about /proc but im having trouble implementing this.  USING C LANGUAGE. I learned about /proc but im having trouble
I have this template, and am not sure how to use it to complete the program.
implementing this. I have this template, and am not sure how to
use it to complete the program. Thanks in advance. Write a default
Thanks in advance.

Write a default version of program to report the behavior of the Linux kernel by inspecting kernel state. The program should print the following values to the user screen or console: CPU model name Kernel version Amount of time since the system was last booted, in the form dd:hh:mm:ss (for example, 3 days 13 hours 46 minutes 32 seconds would be formatted as 03:13:46:32) report date (gettimeofday) and machine hostname #include #include #include int main(int arge, char *argv[]) char repTypeName (16); 1. Determine report type */ reportType = STANDARD; strcpy(repTypeName, "Standard"); if (argc > 1) sscanf (argv[1], "cc", &ci, &c2); if (cl != ''){ fprintf(stderr, "usage: observer (-s)[-1 int dur] "); exit (1); if (c2- 'S') { reportType = SHORT; strcpy (repTypeName, "Short"); if (c2--'l') { report Type = LONG; strcpy(repTypeName, "Long"); interval - atoi (argv[2]); duration - atoi (argv[3])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!