Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Linux system call using C programming. Write a system call that reports the foll

ID: 3712148 • Letter: L

Question

Linux system call using C programming.

Write a system call that reports the following statistics about Linux page cache:

1. the current number of pages in the active list over all memory zones.

2. the current number of pages in the inactive list over all memory zones.

3. the current number of pages in the active list whose reference bit is set over all memory zones.

4. the current number of pages in the inactive list whose reference bit is set over all memory zones.

Write a user level program to test the system call.

Explanation / Answer

#include <stdio.h>

#include <linux/unistd.h>

#include <sys/syscall.h>

#define _memstats_ 327

int main(){

printf("Page size is: %i ", getpagesize());

syscall(_memstats_);

return 0;

}

USING cat /proc/meminfo we can get the answer for all the above questions.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote