write 2 functions on sun solaris(proc file system)
$30-5000 USD
In Progress
Posted about 21 years ago
$30-5000 USD
Paid on delivery
must be done on sun Solaris using c languge some implementations of unix such as sun solaris 2 provide a proc filesystem which maps the image of each process in the system to a file in the /proc [login to view URL] process has a corresponding file named by its process ID. look at the man page on proc .it has all the details. 1-Write a function get_prstatus which has the prototype int get_prstatus(int pid , prstatus_t *sp) the get_prstatus sets the prstatus_t structure pointed to by sp for the process with process ID pid the function return 0 on success and -1 [login to view URL] outline of the get_prstatus producer is *Open /proc/pid for read only *Execute the system call ioctl(fildes,code,s)with code equal to PIOCSTATUS and s being a pointer to a prstatus_t structure *Close the file check for errors on each of the system calls in get_prstatus .do not exit from the function on error--return an error code .be sure to close open file--even if returning an error. 2_ write the function output_prstatus with prototype int output_prstatus(FILE *fp,prstatus_t s ); the output prstatus_t functions writes the contents of s in an easily readable format to the file fp do not worry about the members of type sigset_t.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2)steps for running the program.
## Platform
i wiil run it on ssh secure shell client . xp,melinum,nt,2000