Various attempts at this suggestion (prior to posting) failed. Now,
however, it seems to work fine. Looking back, I think I was freeing memory
before I was finished with it.
I also need to have my eyes examined again. I had rb_block_given() instead
of rb_block_given_p(). This caused in ld error when I would run it, which
led me to believe I had a memory issue somewhere - until I looked at the
error message more closely.
Thanks for the help.
From: ts [mailto:firstname.lastname@example.org]
Sent: Tuesday, June 11, 2002 11:03 AM
Subject: Re: hostent extension problem - returning the ip address
Also, the eventual plan is to use the thread-safe versions
individual vendors, e.g. gethostbyname_r() on Solaris. I
thought I would
start with a basic version and work my way up from there.
Well, even if you use gethostname_r() you must first
allocate the struct
and the buffer. You call gethostname_r(), create the result
(rb_str_new2()), free the struct and buffer and return the
result or call
rb_yield(). You don’t need a Data_Wrap_Struct()