5 * Top - a top users display for Berkeley Unix
7 * General (global) definitions
13 #define Default_DELAY 2
15 /* Number of lines of header information on the standard screen */
16 extern int Header_lines; /* 7 */
18 /* Maximum number of columns allowed for display */
21 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
24 /* Special atoi routine returns either a non-negative number or one of: */
28 /* maximum number we can have */
29 #define Largest 0x7fffffff
32 * The entire display is based on these next numbers being defined as is.
35 #define NUM_AVERAGES 3
37 /* Exit code for system errors */
38 #define TOP_EX_SYS_ERROR 23
40 enum displaymodes { DISP_CPU = 0, DISP_IO, DISP_MAX };
45 #define FMT_SHOWARGS 0x00000001
47 extern enum displaymodes displaymode;
49 extern int pcpu_stats;
50 extern int overstrike;
52 extern const char * myname;
54 extern int (*compares[])(const void*, const void*);
56 char* kill_procs(char *);
57 char* renice_procs(char *);
59 extern char copyright[];
60 /* internal routines */
65 * The space command forces an immediate update. Sometimes, on loaded
66 * systems, this update will take a significant period of time (because all
67 * the output is buffered). So, if the short-term load average is above
68 * "LoadMax", then top will put the cursor home immediately after the space
69 * is pressed before the next update is attempted. This serves as a visual
70 * acknowledgement of the command.
75 * "Nominal_TOPN" is used as the default TOPN when
76 * the output is a dumb terminal. If we didn't do this, then
78 * process in the system when running top on a dumb terminal (or redirected
79 * to a file). Note that Nominal_TOPN is a default: it can still be
80 * overridden on the command line, even with the value "infinity".
82 #define Nominal_TOPN 18
85 * If the local system's getpwnam interface uses random access to retrieve
86 * a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
87 * RANDOM_PW will take advantage of that fact.