Annotation of src/usr.bin/top/top.local.h, Revision 1.3
1.3 ! deraadt 1: /* $OpenBSD: top.local.h,v 1.2 1997/08/14 15:05:04 downsj Exp $ */
1.1 downsj 2:
3: /*
4: * Top - a top users display for Berkeley Unix
5: *
6: * Definitions for things that might vary between installations.
7: */
8:
9: /*
10: * The space command forces an immediate update. Sometimes, on loaded
11: * systems, this update will take a significant period of time (because all
12: * the output is buffered). So, if the short-term load average is above
13: * "LoadMax", then top will put the cursor home immediately after the space
14: * is pressed before the next update is attempted. This serves as a visual
15: * acknowledgement of the command. On Suns, "LoadMax" will get multiplied by
16: * "FSCALE" before being compared to avenrun[0]. Therefore, "LoadMax"
17: * should always be specified as a floating point number.
18: */
19: #ifndef LoadMax
20: #define LoadMax 5.0
21: #endif
22:
23: /*
24: * "Table_size" defines the size of the hash tables used to map uid to
25: * username. The number of users in /etc/passwd CANNOT be greater than
26: * this number. If the error message "table overflow: too many users"
27: * is printed by top, then "Table_size" needs to be increased. Things will
28: * work best if the number is a prime number that is about twice the number
29: * of lines in /etc/passwd.
30: */
31: #ifndef Table_size
32: #define Table_size 503
33: #endif
34:
35: /*
36: * "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity
37: * and the output is a dumb terminal. If we didn't do this, then
38: * installations who use a default TOPN of Infinity will get every
39: * process in the system when running top on a dumb terminal (or redirected
40: * to a file). Note that Nominal_TOPN is a default: it can still be
41: * overridden on the command line, even with the value "infinity".
42: */
43: #ifndef Nominal_TOPN
44: #define Nominal_TOPN 18
45: #endif
46:
47: #ifndef Default_TOPN
1.2 downsj 48: #define Default_TOPN -1
1.1 downsj 49: #endif
50:
51: #ifndef Default_DELAY
52: #define Default_DELAY 5
53: #endif
1.3 ! deraadt 54:
! 55: /*
! 56: * Top users/processes display for Unix
! 57: * Version 3
! 58: *
! 59: * Copyright (c) 1984, 1989, William LeFebvre, Rice University
! 60: * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
! 61: *
! 62: * Redistribution and use in source and binary forms, with or without
! 63: * modification, are permitted provided that the following conditions
! 64: * are met:
! 65: * 1. Redistributions of source code must retain the above copyright
! 66: * notice, this list of conditions and the following disclaimer.
! 67: * 2. Redistributions in binary form must reproduce the above copyright
! 68: * notice, this list of conditions and the following disclaimer in the
! 69: * documentation and/or other materials provided with the distribution.
! 70: *
! 71: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
! 72: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! 73: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
! 74: * IN NO EVENT SHALL THE AUTHOR OR HIS EMPLOYER BE LIABLE FOR ANY DIRECT, INDIRECT,
! 75: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
! 76: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
! 77: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
! 78: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
! 79: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
! 80: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! 81: */
1.1 downsj 82:
83: /*
84: * If the local system's getpwnam interface uses random access to retrieve
85: * a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
86: * RANDOM_PW will take advantage of that fact. If RANDOM_PW is defined,
87: * then getpwnam is used and the result is cached. If not, then getpwent
88: * is used to read and cache the password entries sequentially until the
89: * desired one is found.
90: *
91: * We initially set RANDOM_PW to something which is controllable by the
92: * Configure script. Then if its value is 0, we undef it.
93: */
94:
95: #define RANDOM_PW 1
96: #if RANDOM_PW == 0
97: #undef RANDOM_PW
98: #endif