---Steve Tarkalson said:
> this is solved by one of two methods:
>    1-) require the caller of gethostbyaddr() to supply a pointer to
>        a hostent struct which will be filled.
> or 2-) the library uses thread specific storage which is re-used in
>        each call.
> 
You could malloc() a struct hostent for each call to
gethostby*(), each time registering the hostent in some list along with the
thread's PID. If the same thread calls gethostby*, use the same buffer, or
allocate a new one if another thread calls it. Have a static function be called
atexit to free all the mallocs.

-Joe 




To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to