Mailing List Archive

MAXHOSTNAMELEN
Hullo,

I'm developing a minor fix based around the proper use of
MAXHOSTNAMELEN, which effects 2 lines in util.c.

MAXHOSTNAMELEN is defined (typically) in

/usr/include/sys/param.h

Please can users of different platforms out there do a quick:

grep MAXHOSTNAMELEN /usr/include/sys/*.h

or equivalent, and send me the results, along with the output from 'uname -a',
so I know what you're running.

So far I already know about

FreeBSD /usr/include/sys/param.h (255?, er Paul, I dun't
2.0.5 remember what we found, wanna check today)
SunOS 4.1.3 /usr/include/sys/param.h (64)
Solaris 2.4 /usr/include/netdb.h (256)

HPUX?
LINUX?

I checked Linux 1.2.8...

o sys.param.h contains the code:

#ifdef OLD_LINUX
#undef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 8 /* max length of hostname */
#endif

o asm/types.h sez:

#define MAXHOSTNAMELEN 64

o and rpc/types.h sez:

#define MAXHOSTNAMELEN 64

o Any Linux accolytes have a clue which of these is the real
thing?

OtherOS?

Cheers,
Ay.

Andrew Wilson URL: http://www.cm.cf.ac.uk/User/Andrew.Wilson/
Elsevier Science, Oxford Office: +44 01865 843155 Mobile: +44 0589 616144
Re: MAXHOSTNAMELEN [ In reply to ]
In reply to Andrew Wilson who said
>
> So far I already know about
>
> FreeBSD /usr/include/sys/param.h (255?, er Paul, I dun't
> 2.0.5 remember what we found, wanna check today)

#define MAXHOSTNAMELEN 256 /* max hostname size */

> SunOS 4.1.3 /usr/include/sys/param.h (64)
> Solaris 2.4 /usr/include/netdb.h (256)
>
> HPUX?
> LINUX?
>
> I checked Linux 1.2.8...
>
> o sys.param.h contains the code:
>
> #ifdef OLD_LINUX
> #undef MAXHOSTNAMELEN
> #define MAXHOSTNAMELEN 8 /* max length of hostname */
> #endif
>
> o asm/types.h sez:
>
> #define MAXHOSTNAMELEN 64
>
> o and rpc/types.h sez:
>
> #define MAXHOSTNAMELEN 64
>
> o Any Linux accolytes have a clue which of these is the real
> thing?

Ain't Linux fun :-) Umm, I think MAXHOSTNAMELEN is a fairly standard
thing but in any case, use it and if there are one or two OS's that
are braindead they can be dealt with by defining it to be something
sensible for those OS's in the config file.

Of course, when 1.0 gets out the door and I'm free to work on my new
style configuration this will become much cleaner. :-)

--
Paul Richards, Netcraft Ltd.
Internet: paul@netcraft.co.uk, http://www.netcraft.co.uk
Phone: 0370 462071 (Mobile), +44 1225 447500 (work)
Re: MAXHOSTNAMELEN [ In reply to ]
> So far I already know about
>
> FreeBSD /usr/include/sys/param.h (255?, er Paul, I dun't
> 2.0.5 remember what we found, wanna check today)
> SunOS 4.1.3 /usr/include/sys/param.h (64)
> Solaris 2.4 /usr/include/netdb.h (256)
>
> HPUX?

BSDI (1.1 and 2.0)
/usr/include/sys/param.h:#define MAXHOSTNAMELEN 256

HPUX (9.0x)
/usr/include/sys/param.h:#define MAXHOSTNAMELEN 64
Re: MAXHOSTNAMELEN [ In reply to ]
At 10:42 AM 9/12/95 BST, you wrote:
>Hullo,
>
> I'm developing a minor fix based around the proper use of
>MAXHOSTNAMELEN, which effects 2 lines in util.c.
>
>MAXHOSTNAMELEN is defined (typically) in
>
> /usr/include/sys/param.h
>
> I checked Linux 1.2.8...
>
You really don't have to worry about previous release of the kernel.
1.2.8->1.2.13 are really the only ones we would recommend running
Apache on. 1.2.13 is becoming almost a must.

<Aram>
--
Aram W. Mirzadeh, MIS Manager, Qosina Corporation
http://www.qosina.com/~awm/, awm@qosina.com
Apache httpd server team http://www.apache.org
Re: MAXHOSTNAMELEN [ In reply to ]
In reply to Aram W. Mirzadeh who said
>
> At 10:42 AM 9/12/95 BST, you wrote:
> >Hullo,
> >
> > I'm developing a minor fix based around the proper use of
> >MAXHOSTNAMELEN, which effects 2 lines in util.c.
> >
> >MAXHOSTNAMELEN is defined (typically) in
> >
> > /usr/include/sys/param.h
> >
> > I checked Linux 1.2.8...
> >
> You really don't have to worry about previous release of the kernel.
> 1.2.8->1.2.13 are really the only ones we would recommend running
> Apache on. 1.2.13 is becoming almost a must.

That's not really the issue and Linux is a real problem in this area. Apache
will look really stupid if it mandates a particular version of an OS and
it should therefore compile and run on any version if at all possible. Kernel
bugs that make this impossible are an exception, Apache shouldn't jump
through hoops to fix bugs in an OS, where do you stop, DOS is just an
OS with LOTS of bugs, let's re-write Apache to work around them :-)

In any case, the problem I saw with what Andy posted was, where the hell
do I get MAXHOSTNAMELEN from? It's defined three times and in very obscure
include files. Anyone have a Linux machine they'd give me an account on,
I'd go look around the sources myself then and see what the correct thing
to do is.

--
Paul Richards, Netcraft Ltd.
Internet: paul@netcraft.co.uk, http://www.netcraft.co.uk
Phone: 0370 462071 (Mobile), +44 1225 447500 (work)
Re: MAXHOSTNAMELEN [ In reply to ]
At 02:41 PM 9/12/95 +0100, you wrote:
>
>That's not really the issue and Linux is a real problem in this area. Apache
>will look really stupid if it mandates a particular version of an OS and
>it should therefore compile and run on any version if at all possible. Kernel
>bugs that make this impossible are an exception, Apache shouldn't jump
>through hoops to fix bugs in an OS, where do you stop, DOS is just an
>OS with LOTS of bugs, let's re-write Apache to work around them :-)

AHHHHHH!!! Stop right here... we already had this conversation for
about a week. And as I understand it, we decided to say "It's not our
problem, your OS is broken" that isn't exact, but close enough.
We're not going to look stupid. There are limit, and we set it. I'm not
about to start writing #ifdef LINUX_0.99 everywhere, because we would
like to have it work on every damm machine. If you want to run it....
UPGRADE. Especially for Linux since, it's free, and you can upgrade
the kernel in less than 15 minutes.

>
>In any case, the problem I saw with what Andy posted was, where the hell
>do I get MAXHOSTNAMELEN from? It's defined three times and in very obscure
>include files. Anyone have a Linux machine they'd give me an account on,
>I'd go look around the sources myself then and see what the correct thing
>to do is.

No point, that what the patches are for. Sumbit your patch as you need it
on your machine. If it breaks on another system, then who ever is going
Linux at the time will submit a patch for your patch. And we'll go from there.
It will just take too long to try to find every machine's needs, especially when
the original code will probebly work on 70% of the machines out there.

<Aram>
--
Aram W. Mirzadeh, MIS Manager, Qosina Corporation
http://www.qosina.com/~awm/, awm@qosina.com
Apache httpd server team http://www.apache.org
Re: MAXHOSTNAMELEN [ In reply to ]
At 03:55 PM 9/12/95 BST, you wrote:
>So I asked, anyone know what the *latest* version of Linux prefers as param.h,
>if that's where it keeps its MAXHOSTNAMELENGTH, and what the value of
>MAXHOSTNAMELENGTH is?


from: /usr/include/sys/param.h:

[stuff delete]
/* Don't change it. H.J. */
#ifdef OLD_LINUX
#undef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 8 /* max length of hostname */
#endif
[stuff deleted]

If you would like a full copy of the file, let me know.

<Aram>
--
Aram W. Mirzadeh, MIS Manager, Qosina Corporation
http://www.qosina.com/~awm/, awm@qosina.com
Apache httpd server team http://www.apache.org
Re: MAXHOSTNAMELEN [ In reply to ]
At 03:37 PM 9/12/95 BST, you wrote:
>> At 10:42 AM 9/12/95 BST, you wrote:
>> >Hullo,
>> >
>> > I'm developing a minor fix based around the proper use of
>> >MAXHOSTNAMELEN, which effects 2 lines in util.c.
>> >
>> >MAXHOSTNAMELEN is defined (typically) in
>> >
>> > /usr/include/sys/param.h
>> >
>> > I checked Linux 1.2.8...
>> >
>> You really don't have to worry about previous release of the kernel.
>> 1.2.8->1.2.13 are really the only ones we would recommend running
>> Apache on. 1.2.13 is becoming almost a must.
>
>
>Interesting. So what does that version of Linux have defined?

Unless you define OLD_LINUX, it's not defined at all. Anywhere.

<Aram>
--
Aram W. Mirzadeh, MIS Manager, Qosina Corporation
http://www.qosina.com/~awm/, awm@qosina.com
Apache httpd server team http://www.apache.org
Re: MAXHOSTNAMELEN [ In reply to ]
Wrt to Linux and MAXHOSTNAMELEN:

More precisely, sys/param.h includes linux/param.h which includes
asm/param.h, which sets MAXHOSTNAMELEN to 64.

Then, sys/param.h will make that 8 if OLD_LINUX is set. It is not set
at all in any of the .h files under /usr/include that i can find.

So assume 64 for Linux.

-JimC
--
James H. Cloos, Jr. include <std/qotd>
James.Cloos@JHCloos.COM include <std/disclaimers.h>
Work: cloos@io.com URL: http://www.jhcloos.com/~cloos/
LPF,Usenix,SAGE Snail: POBox 18122 Austin, TX 78760-8122
Re: MAXHOSTNAMELEN [ In reply to ]
> At 10:42 AM 9/12/95 BST, you wrote:
> >Hullo,
> >
> > I'm developing a minor fix based around the proper use of
> >MAXHOSTNAMELEN, which effects 2 lines in util.c.
> >
> >MAXHOSTNAMELEN is defined (typically) in
> >
> > /usr/include/sys/param.h
> >
> > I checked Linux 1.2.8...
> >
> You really don't have to worry about previous release of the kernel.
> 1.2.8->1.2.13 are really the only ones we would recommend running
> Apache on. 1.2.13 is becoming almost a must.


Interesting. So what does that version of Linux have defined?

> <Aram>
> --
> Aram W. Mirzadeh, MIS Manager, Qosina Corporation
> http://www.qosina.com/~awm/, awm@qosina.com
> Apache httpd server team http://www.apache.org
>
>
>
Re: MAXHOSTNAMELEN [ In reply to ]
> >In any case, the problem I saw with what Andy posted was, where the hell
> >do I get MAXHOSTNAMELEN from? It's defined three times and in very obscure
> >include files. Anyone have a Linux machine they'd give me an account on,
> >I'd go look around the sources myself then and see what the correct thing
> >to do is.
>
> No point, that what the patches are for. Sumbit your patch as you need it
> on your machine. If it breaks on another system, then who ever is going
> Linux at the time will submit a patch for your patch. And we'll go from there.
> It will just take too long to try to find every machine's needs, especially when
> the original code will probebly work on 70% of the machines out there.

It won't take too long, and it's my time, and I want to know, and I'm [buzzz]
if I'm gonna wait for list latency to slow up my patches any more. So I'm
trying to work out what this patch needs to look like in the majority of cases,
which includes linux. If the best linux is sensible and keeps its
param.h in /usr/include/sys then it's easy. If not then it's less easy, but still
possible.

So I asked, anyone know what the *latest* version of Linux prefers as param.h,
if that's where it keeps its MAXHOSTNAMELENGTH, and what the value of
MAXHOSTNAMELENGTH is?

...er, please ;)

Ay.

> <Aram>
> --
> Aram W. Mirzadeh, MIS Manager, Qosina Corporation
> http://www.qosina.com/~awm/, awm@qosina.com
> Apache httpd server team http://www.apache.org
Re: MAXHOSTNAMELEN [ In reply to ]
> From owner-new-httpd@hyperreal.com Tue Sep 12 16:55:18 1995
> Resent-From: owner-new-httpd@hyperreal.com
> Resent-Message-Id: <199509121555.QAA24213@epprod.elsevier.co.uk>
> Old-Received: from taz.hyperreal.com by thrall.cs.cf.ac.uk with SMTP (PP) id
> <11536-0@thrall.cs.cf.ac.uk>; Tue, 12 Sep 1995 16:53:52 +0100
> Old-Received: by taz.hyperreal.com (8.6.12/8.6.5) id IAA04311; Tue, 12 Sep
> 1995 08:26:39 -0700
> Old-Received: from luers.qosina.com by taz.hyperreal.com (8.6.12/8.6.5) with
> ESMTP id IAA04305; Tue, 12 Sep 1995 08:26:37 -0700
> >Interesting. So what does that version of Linux have defined?
>
> Unless you define OLD_LINUX, it's not defined at all. Anywhere.

Mmm, as I read it

sys/param.h

includes

linux/param.h

which includes

asm/param.h

which contains the line:

#define MAXHOSTNAMELEN 64 /* max length of hostname */

so basically, linux is cool for sys/param.h. So I'll base my patch on this
assumption, and if it br0kes then, as you rightly say, someone else
will supply a patch for it.

> <Aram>

Cheers,
Ay.