1234567890123456789012345678901234567890123456789012345678901234567890123456789

As of 18/10/2002:

Idea:
	It is very common to need a proccess list... I dont believe there
	is a portable way to do this. (glib seems to try to address this
	problem but it goes the hard way). Probably the most portable way
	to get a process list is to parse the output of the `ps' program.
How:
	libproclist will run ps with the apropriate arguments and parse
	its output.

Requirements:
	Just a working ps that can find out the euid, egid, pid, ppid, tty
	and command name

Limitations:
	This will *NOT* work for FreeBSD since the ps command does *NOT*
	return the effective uid and gid of a process.

Portability:
	It seems to work for: Linux, IRIX, Solaris, AIX and OpenBSD.a

Installation:
	Just configure, make and make install... If the configure script
	is unable to determine the apropriate ps arguments then contact me.

Usage:
	include <proclist.h> in your sources

	Call pl_get_proclist() to get the process listing. It will return:
	-1: In case of an internal error
	0: If ps could not be executed
	>0: The number of processes returned

	there is a struct:

	struct pl_procinfo
	{
		pid_t   pid;
		pid_t   ppid;
		uid_t   euid;
		gid_t   egid;
		char    *tty;
		char    *cmd;
	};

	after calling pl_get_proclist(), process will exist in a table:
	struct pl_procinfo **pl_proclist;

	the order of the data in the table is unspecified

	the number of processes is stored in
	int pl_proclist_count;

	You may get it better if you look proclist.h

	After that compile your program and link it agains libproclist
	(-lproclist)

	A script named proclist-config is also installed. You can use it from
	your configure scripts to get libproclist information.

	Finaly a proclist.m4 is also installed for use from configure.in.
	If you create a program that requires libproclist 1.0.1 then use:
	AC_LIB_PROCLIST(1.0.1)
	It will set CFLAGS, CXXFLAGS and LDFLAGS as needed.
	It will also provide the options:

		--with-proclist=DIR
			to specify the location of libproclist

		--enable-static-proclist
			to statically link against libproclist

	In your Makefile.am or Makefile.in use @LIBPROCLIST@. It will be
	replace with either -lproclist or the full path to the libproclist.a
	(if the user specified --enable-static-proclist).
	See proclist.m4 for more info.

License:

	This library is currently distributed unter the terms of GPLv2.
	If you believe that this doesn't fit your needs contact me and I may
	change it to LGPL.

	This license may change without further notice but will only affect
	future versions.

Home:
	The homepage of libproclist is at http://www.it.teithe.gr/~v13

Send notes bug reports and requests to v13@priest.com

