+ 2

Ps function by c language

How can i make a function that do the work of the command ps on terminal???

16th Apr 2021, 6:36 PM
Nana4 Ever
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/
16th Apr 2021, 7:00 PM
BroFar
BroFar - avatar
+ 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
26th Jun 2022, 8:18 AM
Arun Kumar
Arun Kumar - avatar
0
You can read the source code of "ps" here: https://gitlab.com/procps-ng/procps/-/blob/newlib/ps/display.c
3rd Mar 2022, 10:27 PM
Gabriel
Gabriel - avatar