This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gethostbyname


> > > and can i assume endhostent() will be explicitely called?
> > 
> > Nope. I've seen very few real programs call that. If you port
> > something from Unix its unlikly to call this function. Something you
> > hard craft yourself may. 
> 
> So if you call gethostbyname() only once then you have leaked memory?
> eww.

Well, yes and no. stricktly speaking yes. The result from
gethostbyname is always be valid until the program exits or endhostent
is called. Since this is an embedded system, the program never calls
exit. Since i don't implement endhostent, you cannot tell the DNS
client you have finished with it, so its legaly still valid.

What i don't know is what is the symantics of endhostent() in a multi
threaded enviroment? It would be a bad idea for it to release all
memory since some other thread may still be using there state
information from the last gethostbyname it called. In my opinion, its
safer not to implement this function until someone actually needs it
:-)

> On a related note, when do you think your management team will ok
> releasing your client? I'd be more interested in multiple people
> using (and in turn testing) a single client than deploying mine only
> to find it doesn't work with xyz dns server.

Hard to say. This is probably the first time they have been asked to
release something into the OS world. It may take a while to perswaid
them.

My testing has only been with a Solaris server running Bind. Testing
on other server, and big endian targets would be very interesting.

        Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]