diff -N -c -r -x .defaults ../top-3.5beta9/Configure ./Configure *** ../top-3.5beta9/Configure Fri Dec 18 10:42:29 1998 --- ./Configure Wed Jul 24 22:36:44 2002 *************** *** 503,509 **** -e "s|%topn%|$topn|" \ -e "s|%delay%|$delay|" \ -e "s|%random%|$random|" \ ! top.local.H >top.local.h echo "Building top.1..." sed -e "s|%topn%|$topn|" \ --- 503,509 ---- -e "s|%topn%|$topn|" \ -e "s|%delay%|$delay|" \ -e "s|%random%|$random|" \ ! top.local.h.X >top.local.h echo "Building top.1..." sed -e "s|%topn%|$topn|" \ diff -N -c -r -x .defaults ../top-3.5beta9/Makefile.X ./Makefile.X *** ../top-3.5beta9/Makefile.X Tue Nov 19 21:19:24 1996 --- ./Makefile.X Wed Jul 24 22:37:21 2002 *************** *** 63,69 **** @echo 'You need to run the script "Configure" before running "make".' exit 10 ! top.local.h: top.local.H @echo 'You need to run the script "Configure" before running "make".' exit 10 --- 63,69 ---- @echo 'You need to run the script "Configure" before running "make".' exit 10 ! top.local.h: top.local.h.X @echo 'You need to run the script "Configure" before running "make".' exit 10 diff -N -c -r -x .defaults ../top-3.5beta9/commands.c ./commands.c *** ../top-3.5beta9/commands.c Wed Jul 1 15:30:08 1998 --- ./commands.c Wed Jul 24 22:49:36 2002 *************** *** 446,451 **** --- 446,452 ---- char *str; { + #if defined(PRIO_PROCESS) register char negate; int prio; int procnum; *************** *** 502,507 **** --- 503,509 ---- ERROR(str, errno); } } while ((str = next_field(str)) != NULL); + #endif /* return appropriate error string */ return(err_string()); diff -N -c -r -x .defaults ../top-3.5beta9/machine/m_linux.c ./machine/m_linux.c *** ../top-3.5beta9/machine/m_linux.c Wed Jul 1 15:32:49 1998 --- ./machine/m_linux.c Wed Jul 24 23:15:42 2002 *************** *** 34,47 **** --- 34,61 ---- #include #include /* for HZ */ + + #if 0 #include /* for PAGE_SHIFT */ + #else + #define PAGE_SHIFT 12 + #endif + + #if 0 #include /* for NR_TASKS */ + #else + #define NR_TASKS 1<<12 + #endif #if 0 #include /* for PROC_SUPER_MAGIC */ #else + #ifdef __CYGWIN__ + #define PROC_SUPER_MAGIC 0x700ff + #else #define PROC_SUPER_MAGIC 0x9fa0 #endif + #endif #define PROCFS "/proc" extern char *myname; *************** *** 156,161 **** --- 170,176 ---- { fprintf(stderr, "%s: proc filesystem not mounted on " PROCFS "\n", myname); + fprintf(stderr, " type=%x\n", sb.f_type); return -1; } } diff -N -c -r -x .defaults ../top-3.5beta9/top.c ./top.c *** ../top-3.5beta9/top.c Wed Jul 1 15:41:03 1998 --- ./top.c Wed Jul 24 23:11:00 2002 *************** *** 143,149 **** --- 143,153 ---- static char tempbuf1[50]; static char tempbuf2[50]; + #if 0 int old_sigmask; /* only used for BSD-style signals */ + #else + sigset_t sigmask, old_sigmask; + #endif int topn = Default_TOPN; int delay = Default_DELAY; int displays = 0; /* indicates unspecified */ *************** *** 489,495 **** --- 493,507 ---- sighold(SIGQUIT); sighold(SIGTSTP); #else + #if 0 old_sigmask = sigblock(Smask(SIGINT) | Smask(SIGQUIT) | Smask(SIGTSTP)); + #else + (void) sigemptyset(&sigmask); + (void) sigaddset(&sigmask, SIGINT); + (void) sigaddset(&sigmask, SIGQUIT); + (void) sigaddset(&sigmask, SIGTSTP); + (void) sigprocmask(SIG_BLOCK, &sigmask, &old_sigmask); + #endif #endif init_screen(); (void) signal(SIGINT, leave); *************** *** 503,509 **** --- 515,525 ---- sigrelse(SIGQUIT); sigrelse(SIGTSTP); #else + #if 0 (void) sigsetmask(old_sigmask); + #else + (void) sigprocmask(SIG_SETMASK, &old_sigmask, (sigset_t*)NULL); + #endif #endif if (warnings) { *************** *** 940,945 **** --- 956,963 ---- int i; { + sigset_t sigmask; + /* move to the lower left */ end_screen(); fflush(stdout); *************** *** 951,957 **** --- 969,981 ---- #ifdef SIGRELSE sigrelse(SIGTSTP); #else + #if 0 (void) sigsetmask(sigblock(0) & ~(1 << (SIGTSTP - 1))); + #else + (void) sigemptyset(&sigmask); + (void) sigaddset(&sigmask, SIGTSTP); + (void) sigprocmask(SIG_UNBLOCK, &sigmask, (sigset_t*)NULL); + #endif #endif (void) kill(0, SIGTSTP); diff -N -c -r -x .defaults ../top-3.5beta9/top.local.H ./top.local.H *** ../top-3.5beta9/top.local.H Wed Apr 15 13:30:57 1992 --- ./top.local.H Wed Dec 31 19:00:00 1969 *************** *** 1,68 **** - /* - * Top - a top users display for Berkeley Unix - * - * Definitions for things that might vary between installations. - */ - - /* - * The space command forces an immediate update. Sometimes, on loaded - * systems, this update will take a significant period of time (because all - * the output is buffered). So, if the short-term load average is above - * "LoadMax", then top will put the cursor home immediately after the space - * is pressed before the next update is attempted. This serves as a visual - * acknowledgement of the command. On Suns, "LoadMax" will get multiplied by - * "FSCALE" before being compared to avenrun[0]. Therefore, "LoadMax" - * should always be specified as a floating point number. - */ - #ifndef LoadMax - #define LoadMax %LoadMax% - #endif - - /* - * "Table_size" defines the size of the hash tables used to map uid to - * username. The number of users in /etc/passwd CANNOT be greater than - * this number. If the error message "table overflow: too many users" - * is printed by top, then "Table_size" needs to be increased. Things will - * work best if the number is a prime number that is about twice the number - * of lines in /etc/passwd. - */ - #ifndef Table_size - #define Table_size %TableSize% - #endif - - /* - * "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity - * and the output is a dumb terminal. If we didn't do this, then - * installations who use a default TOPN of Infinity will get every - * process in the system when running top on a dumb terminal (or redirected - * to a file). Note that Nominal_TOPN is a default: it can still be - * overridden on the command line, even with the value "infinity". - */ - #ifndef Nominal_TOPN - #define Nominal_TOPN %NominalTopn% - #endif - - #ifndef Default_TOPN - #define Default_TOPN %topn% - #endif - - #ifndef Default_DELAY - #define Default_DELAY %delay% - #endif - - /* - * If the local system's getpwnam interface uses random access to retrieve - * a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining - * RANDOM_PW will take advantage of that fact. If RANDOM_PW is defined, - * then getpwnam is used and the result is cached. If not, then getpwent - * is used to read and cache the password entries sequentially until the - * desired one is found. - * - * We initially set RANDOM_PW to something which is controllable by the - * Configure script. Then if its value is 0, we undef it. - */ - - #define RANDOM_PW %random% - #if RANDOM_PW == 0 - #undef RANDOM_PW - #endif --- 0 ---- diff -N -c -r -x .defaults ../top-3.5beta9/top.local.h.X ./top.local.h.X *** ../top-3.5beta9/top.local.h.X Wed Dec 31 19:00:00 1969 --- ./top.local.h.X Wed Apr 15 13:30:57 1992 *************** *** 0 **** --- 1,68 ---- + /* + * Top - a top users display for Berkeley Unix + * + * Definitions for things that might vary between installations. + */ + + /* + * The space command forces an immediate update. Sometimes, on loaded + * systems, this update will take a significant period of time (because all + * the output is buffered). So, if the short-term load average is above + * "LoadMax", then top will put the cursor home immediately after the space + * is pressed before the next update is attempted. This serves as a visual + * acknowledgement of the command. On Suns, "LoadMax" will get multiplied by + * "FSCALE" before being compared to avenrun[0]. Therefore, "LoadMax" + * should always be specified as a floating point number. + */ + #ifndef LoadMax + #define LoadMax %LoadMax% + #endif + + /* + * "Table_size" defines the size of the hash tables used to map uid to + * username. The number of users in /etc/passwd CANNOT be greater than + * this number. If the error message "table overflow: too many users" + * is printed by top, then "Table_size" needs to be increased. Things will + * work best if the number is a prime number that is about twice the number + * of lines in /etc/passwd. + */ + #ifndef Table_size + #define Table_size %TableSize% + #endif + + /* + * "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity + * and the output is a dumb terminal. If we didn't do this, then + * installations who use a default TOPN of Infinity will get every + * process in the system when running top on a dumb terminal (or redirected + * to a file). Note that Nominal_TOPN is a default: it can still be + * overridden on the command line, even with the value "infinity". + */ + #ifndef Nominal_TOPN + #define Nominal_TOPN %NominalTopn% + #endif + + #ifndef Default_TOPN + #define Default_TOPN %topn% + #endif + + #ifndef Default_DELAY + #define Default_DELAY %delay% + #endif + + /* + * If the local system's getpwnam interface uses random access to retrieve + * a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining + * RANDOM_PW will take advantage of that fact. If RANDOM_PW is defined, + * then getpwnam is used and the result is cached. If not, then getpwent + * is used to read and cache the password entries sequentially until the + * desired one is found. + * + * We initially set RANDOM_PW to something which is controllable by the + * Configure script. Then if its value is 0, we undef it. + */ + + #define RANDOM_PW %random% + #if RANDOM_PW == 0 + #undef RANDOM_PW + #endif