🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.programming
Article #319

Re: ciekawostka ....

#319
From: k... Krzysztof Halasa
Date: Fri, 16 Feb 1996 00:00
32 lines
1453 bytes
Krzysztof Pulapa (pul...@edison.pk.edu.pl) wrote:

> Mialem taka procedurke :

> 1)  unsigned long ii;
> 2)  struct hostent *pp;
> 3)  ii=inet_addr(hostname);
> 4)  pp=gethostbyaddr((char *)&ii, INADDRSZ, AF_INET);
> 5)  if (pp) return(call_socket(pp->h_name,port)); else return(-1);

> Wbrew pozorom wcale to nie dzialalo , znaczy sie dzialalo na SunOS a na
> Linuxie juz nie ...

z "man gethostbyaddr":

       All information is contained in a static area so  it  must
       be copied if it is to be saved.

Prawdopodobnie call_socket zmienialo zawartosc pp (zmiennej statycznej
w clib), np. przez wykonanie innej funkcji uzywajacej tej samej zmiennej,
przed wykorzystaniem oryginalnej zawartosci.

Greetings,
                                                KHC

--------------------------------------------------------------------
Krzysztof Halasa
Network Administrator of The Palace of Youth in Warsaw

Palac Mlodziezy                      Internet: k...@pm.waw.pl
ul. Swietokrzyska                     Fidonet: KHC, 2:480/40
00-901 Warsaw, Poland
Technical Details
Message-ID: <4g2cpb$abk@hq.pm.waw.pl>
Path: mbox-mo1.pugleaf.net!unknown!not-for-mail
References: <DMrKpx.Bz1@cyf-kr.edu.pl>

Show Full Headers
Complete Article Headers
From: k...@hq.pm.waw.pl (Krzysztof Halasa)
Subject: Re: ciekawostka ....
Date: 1996/02/16
Message-ID: <4g2cpb$abk@hq.pm.waw.pl>
X-Deja-AN: 139637971
references: <DMrKpx.Bz1@cyf-kr.edu.pl>
organization: The Palace of Youth in Warsaw
newsgroups: pl.comp.programming
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit