I was guessing, actually - I knew that didn’t work, I merely put it there as
an “alert” of sorts to point you to the area where I’m having trouble.
Also, the eventual plan is to use the thread-safe versions provided by
individual vendors, e.g. gethostbyname_r() on Solaris. I thought I would
start with a basic version and work my way up from there.
From: ts [mailto:firstname.lastname@example.org]
Sent: Tuesday, June 11, 2002 10:26 AM
Subject: Re: hostent extension problem - returning the ip address
hp = gethostbyname(h);
pptr = hp->h_addr_list;
Data_Wrap_Struct(cHost,0,host_free,pptr); /* problem here? */
Why do you use Data_Wrap_Struct() ?
On Solaris 8, for gethostbyname(3)
The functions gethostbyname(), gethostbyaddr(), and gethos- tent() use static storage that is reused in each call, mak- ^^^^^^^^^^^^^^ ing these functions unsafe for use in multi-threaded appli- cations.