develooper Front page | perl.perl5.porters | Postings from February 2000

Re: fixing Sys::Hostname

Thread Previous | Thread Next
Tom Christiansen
February 7, 2000 06:03
Re: fixing Sys::Hostname
Message ID:
>>Here's what we have to do.
>>We already at Configure time the check to determine whether the
>>system contains gethostname(2).  Yet, we do not let the user call
>>it!  We should change the module so that it calls the proper function
>>right out of the C library, and stop playing these dumb hacks.  If
>>the function does not exist, only then we should call the `hostname`
>>program if we can.  It's much faster than pulling in POSIX::uname.
>>Only in the absence of gethostname(2) and hostname(1) should uname(3)
>>be attempted, since it is apt to be wrong, and very expensive to
>>boot.  Even still, you should call it from C, not Perl, so you don't
>>pay that insane POSIX module's price for such basic functionality.

>Exactly - I have never understood why gethostname() was not built
>in in the first place.

That would be the cleanest, fastest, and easiest thing to do.
One might be able to do so backwards compatibly, too.

I'd like to see this fixed.  Can anyone say why *not* to fix it?
If not, let's just do it.  Please.

I don't have much faith that any of my issues raised in the last
week actually shall get fixed, though.  I saw the XS version of
Syslog come in, but saw no commentary.  And the only comment on the
many local() issues and the issues was a curt but not
unkind one from Ilya.  And not a single one of you has paid attention
to the tmpfile problem that's triggered a couple dozen bugtraq
reports against Perl in the last six months.

Yeah, I'm discouraged.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About