2 * top.c a slightly modified wmtop.c -- copied from the WindowMaker and gkrelltop
4 * Modified by Brenden Matthews
6 * Modified by Adi Zaimi
8 * Derived by Dan Piponi dan@tanelorn.demon.co.uk
9 * http://www.tanelorn.demon.co.uk
10 * http://wmtop.sourceforge.net
11 * from code originally contained in wmsysmon by Dave Clark
13 * This software is licensed through the GNU General Public License.
17 * Ensure there's an operating system defined. There is *no* default
18 * because every OS has it's own way of revealing CPU/memory usage.
19 * compile with gcc -DOS ...
22 /******************************************/
24 /******************************************/
27 #define CPU_THRESHHOLD 0 /* threshhold for the cpu diff to appear */
44 #include <sys/param.h>
45 #include <sys/types.h>
46 #include <sys/ioctl.h>
51 /******************************************/
53 /******************************************/
57 * XXX: I shouldn't really use this BUFFER_LEN variable but scanf is so
58 * lame and it'll take me a while to write a replacement.
60 #define BUFFER_LEN 1024
62 #define PROCFS_TEMPLATE "/proc/%d/stat"
63 #define PROCFS_TEMPLATE_MEM "/proc/%d/statm"
64 #define PROCFS_CMDLINE_TEMPLATE "/proc/%d/cmdline"
67 /******************************************/
69 /******************************************/
77 /******************************************/
79 /******************************************/
82 * Pointer to head of process list
84 void process_find_top(struct process **);