= Description
   A Ruby interface for gathering process information.

= Prerequisites
* Ruby 1.8.2 or later
* Test::Unit 2.x

= Supported Platforms
* Windows NT family (NT, 2000, XP, etc)
* Linux
* FreeBSD
* Solaris 2.8+
* HP-UX
* OS X

= Installation
* rake test (optional)
* rake install

= Synopsis
   require 'sys/proctable'
   include Sys

   # Everything
   ProcTable.ps{ |p|
      puts p.pid.to_s
      puts p.comm
      ...
   }

   or

   # Just one process
   s = ProcTable.ps(2123)
   puts s.pid.to_s
   puts s.comm
   ...

   # Return the results as an array of ProcTableStructs
   a = ProcTable.ps
   a.each do |p|
      puts a.pid
      ...
   end

= Notes 
   Windows users may pass a host name as a second argument to get process
   information from a different host. This relies on the WMI service running.

   If you're building C source code, the ts_all.rb file is autogenerated for
   you.

= Known Issues
=== FreeBSD
   If you're building on FreeBSD, a standard /proc filesystem read approach is
   used if mounted. Otherwise, a kvm interface is used. There are more fields
   available with the kvm interface, but keep in mind that you need to be a
   member of the kvm group (or root) to use this. You can tweak the extconf.rb
   file manually if you want to force the issue.
   
=== OpenBSD, NetBSD
   This library will attempt to use the kvm interface. It is untested,
   however.

=== Solaris
   The cmdline member on Solaris is limited to 80 characters unless you (or
   your program) own the process. This is a Solaris design flaw/feature.

=== OS X
   At the moment you do not get the full command line string. The code required
   to get this information is obnoxious and I don't have any compelling desire
   to add it. However, if you're willing to submit a patch I'll accept it.

   You can find a good starting point with the OS X code found in Dan Urist's
   Proc::ProcessTable module. You can find that module on CPAN. Point your
   browser at http://search.cpan.org.

=== Misc
   If you build your library as a C extension (which is what will happen if
   you run the 'build', 'test', or 'install' Rake tasks), then the .rb files
   file under 'lib/sys/' are renamed to '.orig', except top.rb. This is
   necessary to prevent mkmf from installing them during a 'make install'.

   The 'clean' Rake task will rename them back to '.rb'.

=== Thread Safety
   I am not currently using a thread-safe version of readdir().  I am not
   especially concerned about it either.  If you are trying to read information
   out of /proc from different threads at the same time there is something
   seriously wrong with your code logic. Using readdir_r() still won't solve
   all potential thread safety issues anyway.

= Future Plans
   Research has indicated that the kvm approach is less favored than a sysctl
   approach on BSD variants. I will try to add this interface in a future
   release.

= Acknowledgements
   This library is largely based on the Perl module Proc::ProcessTable by
   Dan Urist. Many ideas, as well as large chunks of code, were taken
   from his work. So, a big THANK YOU goes out to Dan Urist.

   A big thanks also goes out to Mike Hall who was very helpful with ideas,
   logic and testing.

   Thanks also go to Sean Chittenden for providing an account on one of his
   FreeBSD machines. This is how the FreeBSD support was (initially) added.

   Thanks go to James Hranicky for providing a patch that grabs name, eid,
   euid, gid and guid info in the Linux version, along with some general
   debugging help.

   Finally I'd like to thank all the folks who have submitted bug reports
   and/or patches.

= Help Wanted
   I do not have access to all platforms. There are a few other major platforms
   out there, namely AIX, OpenBSD, and IRIX, among others, that I would
   like to see ports for. There are two ways you can help - either submit code
   for your particular platform or give me an account on your platform so I can
   develop on it.

= More documentation
   See the documentation under the 'doc' directory for more information,
   including platform specific notes and issues.

= License
   Ruby's
    
= Copyright
   (C) 2003-2009 Daniel J. Berger
   All Rights Reserved.

= Author
   Daniel J. Berger
   djberg96 at nospam at gmail dot com
   imperator on IRC (Freenode)
