I'm making a program that can see if page faults occur in some processes,
and my method to do this is to get all process's PIDs and see rss, maj_flt etc. by seeking in every single /proc/[PID], checking if there's a change in total maj_flt.
But in order to get all running process's PIDs, I need to get those directly from my C program, without using existing shell commands like ps, top etc.
Does anyone know where the running PID data exists in /proc or somewhere else? Or if there's another way to do this, like getting it by system call function in my C program?