diff options
author | Mikael Hallendal <hallski@gentoo.org> | 2001-12-27 17:47:01 +0000 |
---|---|---|
committer | Mikael Hallendal <hallski@gentoo.org> | 2001-12-27 17:47:01 +0000 |
commit | 85c8d5438a94d3b1dd4b09ae0362a3b386db75b1 (patch) | |
tree | 2e8d1600350ef8a2fb77b68f9ca1b9d063682eef /sys-apps/procps | |
parent | removed objprelink globally (diff) | |
download | historical-85c8d5438a94d3b1dd4b09ae0362a3b386db75b1.tar.gz historical-85c8d5438a94d3b1dd4b09ae0362a3b386db75b1.tar.bz2 historical-85c8d5438a94d3b1dd4b09ae0362a3b386db75b1.zip |
cleaned up, fixed so that it worked, applied patches from SRPM
Diffstat (limited to 'sys-apps/procps')
6 files changed, 395 insertions, 0 deletions
diff --git a/sys-apps/procps/files/2.0.7/procps-2.0.7-bigbuff.patch b/sys-apps/procps/files/2.0.7/procps-2.0.7-bigbuff.patch new file mode 100644 index 000000000000..9b5565fcf39b --- /dev/null +++ b/sys-apps/procps/files/2.0.7/procps-2.0.7-bigbuff.patch @@ -0,0 +1,11 @@ +--- procps-2.0.7/vmstat.c.bigbuff Mon Mar 5 14:10:08 2001 ++++ procps-2.0.7/vmstat.c Mon Mar 5 14:10:14 2001 +@@ -38,7 +38,7 @@ + + #define NDEBUG !DEBUG + +-#define BUFFSIZE 4096 ++#define BUFFSIZE 8192 + #define FALSE 0 + #define TRUE 1 + diff --git a/sys-apps/procps/files/2.0.7/procps-2.0.7-biguid.patch b/sys-apps/procps/files/2.0.7/procps-2.0.7-biguid.patch new file mode 100644 index 000000000000..ceb7062c949f --- /dev/null +++ b/sys-apps/procps/files/2.0.7/procps-2.0.7-biguid.patch @@ -0,0 +1,26 @@ +--- procps-2.0.7/ps/parser.c.biguid Thu Feb 1 15:27:25 2001 ++++ procps-2.0.7/ps/parser.c Thu Feb 1 15:27:53 2001 +@@ -96,10 +96,8 @@ + if(!passwd_data) return uidexist; + num = passwd_data->pw_uid; + } +- if(num>65534) return uidrange; /* 65535 is very bad */ +- if(num<-32768) return uidrange; + if(num==-1) return uidrange; /* -1 is very bad */ +- num &= 0xffff; ++ num &= 0xffffffff; + ret->uid = num; + return 0; + } +@@ -116,10 +114,8 @@ + if(!group_data) return gidexist; + num = group_data->gr_gid; + } +- if(num>65534) return gidrange; /* 65535 is very bad */ +- if(num<-32768) return gidrange; + if(num==-1) return gidrange; /* -1 is very bad */ +- num &= 0xffff; ++ num &= 0xffffffff; + ret->gid = num; + return 0; + } diff --git a/sys-apps/procps/files/2.0.7/procps-2.0.7-locale.patch b/sys-apps/procps/files/2.0.7/procps-2.0.7-locale.patch new file mode 100644 index 000000000000..a99f3846d0e4 --- /dev/null +++ b/sys-apps/procps/files/2.0.7/procps-2.0.7-locale.patch @@ -0,0 +1,154 @@ +--- procps-2.0.7/proc/sysinfo.c.jj Mon Jul 10 15:36:13 2000 ++++ procps-2.0.7/proc/sysinfo.c Wed Jul 26 22:46:31 2000 +@@ -58,13 +58,41 @@ static char buf[1024]; + + #define SET_IF_DESIRED(x,y) if(x) *(x) = (y) /* evals 'x' twice */ + ++/* /proc files are output in C locale, while we might be using ++ * some other locale. Make sure we parse double values with ++ * a "C" locale dot. ++ */ ++#define ONE_DOUBLE(val, buf, failed) ({ \ ++ double _d; \ ++ char *_p, *_q; \ ++ val = strtoul(buf, &_p, 10); \ ++ if (_p == buf && *_p != '.') \ ++ failed = 1; \ ++ if (*_p == '.') { \ ++ _p++; \ ++ if (*_p >= '0' && *_p <= '9') { \ ++ _d = strtoul(_p, &_q, 10); \ ++ while (_p != _q) _d /= 10, _p++; \ ++ if (val < 0) \ ++ val -= _d; \ ++ else \ ++ val += _d; \ ++ } \ ++ } \ ++ _p; }) ++ + + /***********************************************************************/ + int uptime(double *uptime_secs, double *idle_secs) { + double up=0, idle=0; ++ char *p; ++ int failed = 0; + + FILE_TO_BUF(UPTIME_FILE,uptime_fd); +- if (sscanf(buf, "%lf %lf", &up, &idle) < 2) { ++ p = ONE_DOUBLE(up, buf, failed); ++ if (*p != ' ' && *p != '\t') failed = 1; ++ ONE_DOUBLE(idle, p, failed); ++ if (failed) { + fprintf(stderr, "bad data in " UPTIME_FILE "\n"); + return 0; + } +@@ -107,9 +135,9 @@ static int init_Hertz_value(void){ + unsigned long user_j, nice_j, sys_j, other_j; /* jiffies (clock ticks) */ + double up_1, up_2, seconds; + unsigned long jiffies, h; +- int i = 0; ++ int i = 0, failed = 0; + do{ +- FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1); ++ FILE_TO_BUF(UPTIME_FILE,uptime_fd); ONE_DOUBLE(up_1, buf, failed); + /* uptime(&up_1, NULL); */ + FILE_TO_BUF(STAT_FILE,stat_fd); + /* If we are SMP, then the first line is the sum of jiffies by all CPUs */ +@@ -118,7 +146,7 @@ static int init_Hertz_value(void){ + sscanf(buf, "cpu %lu %lu %lu %lu\n%n", + &user_j, &nice_j, &sys_j, &other_j, &i); + sscanf(buf+i, "cpu0 %lu %lu %lu %lu", &user_j, &nice_j, &sys_j, &other_j); +- FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_2); ++ FILE_TO_BUF(UPTIME_FILE,uptime_fd); ONE_DOUBLE(up_2, buf, failed); + /* uptime(&up_2, NULL); */ + } while((long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */ + jiffies = user_j + nice_j + sys_j + other_j; +@@ -171,9 +199,16 @@ int four_cpu_numbers(JT *uret, JT *nret, + /***********************************************************************/ + int loadavg(double *av1, double *av5, double *av15) { + double avg_1=0, avg_5=0, avg_15=0; ++ char *p; ++ int failed = 0; + + FILE_TO_BUF(LOADAVG_FILE,loadavg_fd); +- if (sscanf(buf, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) { ++ p = ONE_DOUBLE(avg_1, buf, failed); ++ if (*p != ' ' && *p != '\t') failed = 1; ++ p = ONE_DOUBLE(avg_5, p, failed); ++ if (*p != ' ' && *p != '\t') failed = 1; ++ ONE_DOUBLE(avg_15, p, failed); ++ if (failed) { + fprintf(stderr, "bad data in " LOADAVG_FILE "\n"); + exit(1); + } +--- procps-2.0.7/top.c.jj Thu Jul 13 16:19:21 2000 ++++ procps-2.0.7/top.c Wed Jul 26 22:56:27 2000 +@@ -101,6 +101,8 @@ + #include <setjmp.h> + #include <stdarg.h> + #include <sys/param.h> ++#include <locale.h> ++#include <langinfo.h> + + #include "proc/sysinfo.h" + #include "proc/procps.h" +@@ -123,6 +125,7 @@ extern void register_sort_function (int + + static int *cpu_mapping; + static int nr_cpu; ++static char *decimal_point; + + /*####################################################################### + *#### Startup routines: parse_options, get_options, ############## +@@ -344,6 +347,7 @@ int main(int argc, char **argv) + struct sigaction sact; + + setlocale(LC_ALL, ""); ++ decimal_point = nl_langinfo(DECIMAL_POINT); + get_options(); + + /* set to PCPU sorting */ +@@ -1423,12 +1427,12 @@ void do_stats(proc_t** p, float elapsed_ + idle_ticks *= nr_cpu; + } + printf("CPU states:" +- " %2ld.%ld%% user, %2ld.%ld%% system," +- " %2ld.%ld%% nice, %2ld.%ld%% idle", +- user_ticks / 10UL, user_ticks % 10UL, +- system_ticks / 10UL, system_ticks % 10UL, +- nice_ticks / 10UL, nice_ticks % 10UL, +- idle_ticks / 10UL, idle_ticks % 10UL); ++ " %2ld%s%ld%% user, %2ld%s%ld%% system," ++ " %2ld%s%ld%% nice, %2ld%s%ld%% idle", ++ user_ticks / 10UL, decimal_point, user_ticks % 10UL, ++ system_ticks / 10UL, decimal_point, system_ticks % 10UL, ++ nice_ticks / 10UL, decimal_point, nice_ticks % 10UL, ++ idle_ticks / 10UL, decimal_point, idle_ticks % 10UL); + PUTP(top_clrtoeol); + putchar('\n'); + } +@@ -1458,16 +1462,16 @@ void do_stats(proc_t** p, float elapsed_ + + i_ticks_o[i] + n_ticks_o[i]); + if (Irixmode) cpumap=i; + else cpumap=cpu_mapping[i]; +- printf ("CPU%d states: %2d.%-d%% user, %2d.%-d%% system," +- " %2d.%-d%% nice, %2d.%-d%% idle", ++ printf ("CPU%d states: %2d%s%-d%% user, %2d%s%-d%% system," ++ " %2d%s%-d%% nice, %2d%s%-d%% idle", + cpumap, +- (u_ticks - u_ticks_o[i] + n_ticks - n_ticks_o[i]) * 100 / t_ticks, ++ (u_ticks - u_ticks_o[i] + n_ticks - n_ticks_o[i]) * 100 / t_ticks, decimal_point, + (u_ticks - u_ticks_o[i]) * 100 % t_ticks / 100, +- (s_ticks - s_ticks_o[i]) * 100 / t_ticks, ++ (s_ticks - s_ticks_o[i]) * 100 / t_ticks, decimal_point, + (s_ticks - s_ticks_o[i]) * 100 % t_ticks / 100, +- (n_ticks - n_ticks_o[i]) * 100 / t_ticks, ++ (n_ticks - n_ticks_o[i]) * 100 / t_ticks, decimal_point, + (n_ticks - n_ticks_o[i]) * 100 % t_ticks / 100, +- (i_ticks - i_ticks_o[i]) * 100 / t_ticks, ++ (i_ticks - i_ticks_o[i]) * 100 / t_ticks, decimal_point, + (i_ticks - i_ticks_o[i]) * 100 % t_ticks / 100); + s_ticks_o[i] = s_ticks; + u_ticks_o[i] = u_ticks; + diff --git a/sys-apps/procps/files/2.0.7/procps-2.0.7-negvalue.patch b/sys-apps/procps/files/2.0.7/procps-2.0.7-negvalue.patch new file mode 100644 index 000000000000..3999ab84ddae --- /dev/null +++ b/sys-apps/procps/files/2.0.7/procps-2.0.7-negvalue.patch @@ -0,0 +1,45 @@ +--- procps-2.0.7/top.c.org Mon Jan 22 16:25:40 2001 ++++ procps-2.0.7/top.c Mon Jan 22 16:59:34 2001 +@@ -1276,6 +1276,19 @@ + return mem[meminfo_main][meminfo_total] >> 10; + } + ++ ++ ++/* Trim to zero if we get negative time ticks, which ++ may happen on some kernels. (see Bugzilla Bug #18380). ++ This hack gives at least a nicer output (hdeller@redhat.com) ++*/ ++static unsigned int trimzero( int x ) ++{ ++ if (x<=0) ++ return 0; ++ return x; ++} ++ + /* + * Calculates the number of tasks in each state (running, sleeping, etc.). + * Calculates the CPU time in each state (system, user, nice, etc). +@@ -1465,14 +1478,14 @@ + printf ("CPU%d states: %2d%s%-d%% user, %2d%s%-d%% system," + " %2d%s%-d%% nice, %2d%s%-d%% idle", + cpumap, +- (u_ticks - u_ticks_o[i] + n_ticks - n_ticks_o[i]) * 100 / t_ticks, decimal_point, +- (u_ticks - u_ticks_o[i]) * 100 % t_ticks / 100, +- (s_ticks - s_ticks_o[i]) * 100 / t_ticks, decimal_point, +- (s_ticks - s_ticks_o[i]) * 100 % t_ticks / 100, +- (n_ticks - n_ticks_o[i]) * 100 / t_ticks, decimal_point, +- (n_ticks - n_ticks_o[i]) * 100 % t_ticks / 100, +- (i_ticks - i_ticks_o[i]) * 100 / t_ticks, decimal_point, +- (i_ticks - i_ticks_o[i]) * 100 % t_ticks / 100); ++ trimzero(u_ticks - u_ticks_o[i] + n_ticks - n_ticks_o[i]) * 100 / t_ticks, decimal_point, ++ trimzero(u_ticks - u_ticks_o[i]) * 100 % t_ticks / 100, ++ trimzero(s_ticks - s_ticks_o[i]) * 100 / t_ticks, decimal_point, ++ trimzero(s_ticks - s_ticks_o[i]) * 100 % t_ticks / 100, ++ trimzero(n_ticks - n_ticks_o[i]) * 100 / t_ticks, decimal_point, ++ trimzero(n_ticks - n_ticks_o[i]) * 100 % t_ticks / 100, ++ trimzero(i_ticks - i_ticks_o[i]) * 100 / t_ticks, decimal_point, ++ trimzero(i_ticks - i_ticks_o[i]) * 100 % t_ticks / 100); + s_ticks_o[i] = s_ticks; + u_ticks_o[i] = u_ticks; + n_ticks_o[i] = n_ticks; diff --git a/sys-apps/procps/files/2.0.7/procps-2.0.7-retcode.patch b/sys-apps/procps/files/2.0.7/procps-2.0.7-retcode.patch new file mode 100644 index 000000000000..b3b1620b2b0e --- /dev/null +++ b/sys-apps/procps/files/2.0.7/procps-2.0.7-retcode.patch @@ -0,0 +1,66 @@ +--- procps-2.0.7/sysctl.c.retcode Thu Feb 1 14:09:42 2001 ++++ procps-2.0.7/sysctl.c Thu Feb 1 14:21:21 2001 +@@ -40,7 +40,7 @@ + * Function Prototypes + */ + int Usage(const char *name); +-void Preload(const char *filename); ++int Preload(const char *filename); + int WriteSetting(const char *setting); + int ReadSetting(const char *setting); + int DisplayAll(const char *path, bool ShowTableUtil); +@@ -102,8 +102,7 @@ + preloadfile = *argv; + } /* endif */ + +- Preload(preloadfile); +- return(0); ++ return Preload(preloadfile); + break; + case 'a': + case 'A': +@@ -120,7 +119,8 @@ + SwitchesAllowed = false; + if (WriteMode) + ReturnCode = WriteSetting(*argv); +- else ReadSetting(*argv); ++ else ++ ReturnCode = ReadSetting(*argv); + } /* end if */ + } /* end for */ + +@@ -176,17 +176,18 @@ + * - we parse the file and then reform it (strip out whitespace) + * + */ +-void Preload(const char *filename) { ++int Preload(const char *filename) { + FILE *fp; + char oneline[257]; + char buffer[257]; + char *t; + int n = 0; ++int rc = 0, i; + char *name, *value; + + if (!filename || ((fp = fopen(filename, "r")) == NULL)) { + fprintf(stderr, ERR_PRELOAD_FILE, filename); +- return; ++ return -1; + } /* endif */ + + while (fgets(oneline, 256, fp)) { +@@ -218,10 +219,12 @@ + value++; + + sprintf(buffer, "%s=%s", name, value); +- WriteSetting(buffer); ++ i = WriteSetting(buffer); ++ rc = rc ? rc : i; + } /* endwhile */ + + fclose(fp); ++ return rc; + } /* end Preload() */ + + diff --git a/sys-apps/procps/files/2.0.7/procps-2.0.7-sysctl-error.patch b/sys-apps/procps/files/2.0.7/procps-2.0.7-sysctl-error.patch new file mode 100644 index 000000000000..5a66210cbe37 --- /dev/null +++ b/sys-apps/procps/files/2.0.7/procps-2.0.7-sysctl-error.patch @@ -0,0 +1,93 @@ +--- procps-2.0.7/sysctl.c.error Thu Mar 22 11:51:24 2001 ++++ procps-2.0.7/sysctl.c Thu Mar 22 11:54:27 2001 +@@ -53,6 +53,7 @@ + const char *PROC_PATH = "/proc/sys/"; + const char *DEFAULT_PRELOAD = "/etc/sysctl.conf"; + static bool PrintName; ++static bool IgnoreError; + + /* error messages */ + const char *ERR_UNKNOWN_PARAMETER = "error: Unknown parameter '%s'\n"; +@@ -79,6 +80,7 @@ + const char *preloadfile = DEFAULT_PRELOAD; + + PrintName = true; ++ IgnoreError = false; + + if (argc < 2) { + return Usage(me); +@@ -92,6 +94,9 @@ + case 'n': + PrintName = false; + break; ++ case 'e': ++ IgnoreError = true; ++ break; + case 'w': + SwitchesAllowed = false; + WriteMode = true; +@@ -220,7 +225,8 @@ + + sprintf(buffer, "%s=%s", name, value); + i = WriteSetting(buffer); +- rc = rc ? rc : i; ++ if (!IgnoreError) ++ rc = rc ? rc : i; + } /* endwhile */ + + fclose(fp); +@@ -283,7 +289,8 @@ + if (!fp) { + switch(errno) { + case ENOENT: +- fprintf(stderr, ERR_INVALID_KEY, outname); ++ if (!IgnoreError) ++ fprintf(stderr, ERR_INVALID_KEY, outname); + break; + case EACCES: + fprintf(stderr, ERR_PERMISSION_DENIED, outname); +@@ -292,7 +299,10 @@ + fprintf(stderr, ERR_UNKNOWN_WRITING, errno, outname); + break; + } /* end switch */ +- rc = -1; ++ if (IgnoreError) ++ rc = 0; ++ else ++ rc = -1; + } else { + fprintf(fp, "%s\n", value); + fclose(fp); +--- procps-2.0.7/sysctl.8.error Thu Mar 22 11:53:25 2001 ++++ procps-2.0.7/sysctl.8 Thu Mar 22 11:54:48 2001 +@@ -10,15 +10,15 @@ + .SH NAME + sysctl \- configure kernel parameters at runtime + .SH SYNOPSIS +-.B "sysctl [-n] variable ..." ++.B "sysctl [-n] [-e] variable ..." + .br +-.B "sysctl [-n] -w variable=value ..." ++.B "sysctl [-n] [-e] -w variable=value ..." + .br +-.B "sysctl [-n] -p <filename> (default /etc/sysctl.conf)" ++.B "sysctl [-n] [-e] -p <filename> (default /etc/sysctl.conf)" + .br +-.B "sysctl [-n] -a" ++.B "sysctl [-n] [-e] -a" + .br +-.B "sysctl [-n] -A" ++.B "sysctl [-n] [-e] -A" + .SH DESCRIPTION + .B sysctl + is used to modify kernel parameters at runtime. The parameters available +@@ -41,6 +41,9 @@ + .TP + .B "-n" + Use this option to disable printing of the key name when printing values. ++.TP ++.B "-e" ++Use this option to ignore errors about unknown keys. + .TP + .B "-w" + Use this option when you want to change a sysctl setting. |