V13
English  Greek 
Projects libproclist 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.