[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-inetutils] More of a feature request than a bug fix
From: |
David Horton |
Subject: |
[bug-inetutils] More of a feature request than a bug fix |
Date: |
Tue, 14 Jan 2003 19:40:05 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 |
Dear inetutils developers,
I am writing to ask you to consider removing or recoding some of the
features in "ping" to make it run without so many library dependencies.
I recently built the inetutils-1.4.1 package with the intention of
using "ping" on a boot/root disk set. Unfortunately "ping" along with
libm, libresolv and so on was too big to fit on the tiny disk set.
I took a look at the source code to find out why ping would need libm.
I believe the only libm function used is sqrt() to find the standard
deviation on line 602 of ping_echo.c. I would like to suggest that the
standard deviation calculation either be removed or recoded using a
successive approximation square root function like Newton's Method (see
my cheesy example code below.)
I'm not sure how to deal with the libresolv dependency since my
programming skills are not that good. I thought that the libnss portion
of glibc should take care of any hostname lookups.
It would be great if a few changes could get "ping" slimmed down to the
point of only needing glibc and ld-linux. This would do a lot to keep
the root filesystem small on bootdisks and other space constrained
GNU/Linux installations.
Dave
P.S. Thanks for all of your time and dedication to inetutils and the
free software movement.
Cheesy Example of Newton's method of finding square root:
#include <stdio.h>
#include <unistd.h>
int main (void) {
float n, guess, next_guess, guess_diff;
n = 225;
printf("The number is %7.2f.\n",n);
guess = 0.5 * n;
printf("My first guess for its square root is %7.2f.\n",guess);
do {
next_guess = 0.5 * ( n / guess + guess );
printf("My next guess is %7.2f.\n",next_guess);
guess_diff = fabs(next_guess - guess);
printf("There's a difference of: %7.2f from my last
guess.\n",guess_diff);
guess = next_guess;
} while (guess_diff > 0.005);
printf("I found the answer! It is %7.2f.\n",guess);
}
Re: [bug-inetutils] More of a feature request than a bug fix, Alfred M. Szmidt, 2003/01/15