C - pstree equivalent -
in bash there pstree command 'draws' tree of processes. wondering similar function in c programming language?
a simple example appreciated.
there no such 'function' in c. can program creates alike, using execl()
/system()
calls ps
, or reading /proc file system (on linux).
from there, can children list of every process, , each process of list children etc.. starting process 1 init
.
otherwise,
int main() { system('pstree'); return 0; }
would work :-)
if want reimplement it, you'd better follow carl norum's advice use source, luke!
Comments
Post a Comment