Use the /proc file system to simulate the command top on a Solaris machine. The information for each process is stored in /proc/PID/psinfo. You must read its entire contents as a type named psinfo_t for process information type. One of its fields that you must use is a type named lwpsinfo_t for light weight process information type. You need to include the library file named procfs.h. One of the fields of psinfo_t is pr_pctcpu which stores the percentage of the CPU time that the process has recently used. But the field stores a 16 bit binary fraction between 0 and 1 which requires conversion to a decimal percentage. Other fields may need conversion. You must use opendir() then readdir() rather than scandir(). You need not simulate the global part of top. The global part reports load average, totals for processes and CPU, memory and swap usage.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.
## Platform
Solaris SunOS 5.9