+ 2
Ps function by c language
How can i make a function that do the work of the command ps on terminal???
3 Answers
+ 5
Nana4 Ever here is a reference which may be helpful if you are looking for processing status.
https://www.geeksforgeeks.org/getting-system-and-process-information-using-c-programming-and-shell-in-linux/
+ 1
You can execute the Linux command through a c program to get the details of the process using system function of stdlib header file.
https://www.techcrashcourse.com/2015/08/system-stdlib-c-library-function.html
https://www.techcrashcourse.com/2015/08/stdlib-h-c-standard-library-functions.html
0
You can read the source code of "ps" here: https://gitlab.com/procps-ng/procps/-/blob/newlib/ps/display.c