libproclist 1.0.2 review
Downloadlibproclist is a very simple and easy to use C library that returns the process listing using ps. It is very portable and is known
|
|
libproclist is a very simple and easy to use C library that returns the process listing using ps.
It is very portable and is known to work on Linux, Irix, AIX, Solaris and OpenBSD. libproclist doesn't, however, work for FreeBSD.
Usage:
The installation is as simple as `configure', `make' and `make install'.
The interface of the library is:
struct pl_procinfo
{
pid_t pid;
pid_t ppid;
uid_t euid;
gid_t egid;
char *tty;
char *cmd;
};
struct pl_procinfo **pl_proclist;
int pl_proclist_count;
/*
Get the process list.
Return:
-1: Internal error
0: Error executing ps
>0: Number of processes
*/
int pl_get_proclist();
Just call pl_get_proclist() and it will allocate the pl_proclist table which will contain pl_proclist_count elements. Each element is a process.
libproclist 1.0.2 keywords