From: Matthew Mondor <mm_lists@pu...> - 2009-07-28 07:52:10
I've noticed a FIXME comment in the contrib/sockets/sockets.lisp code
asking if the hostent structure should be freed.
I just wanted to confirm that gethostbyname(2)/gethostbyaddr(2) return
a pointer to static storage, which means they indeed don't need to be
freed, but it also means that they're not thread-safe. The
getnameinfo(2)/getaddrinfo(2) interface deprecates the older interface
and uses supplied pointers instead of returning them (and more easily
supports more address families transparently).
The comment can therefore safely be removed. About the thread safety
issue, it'd be possible for thread-enabled builds to wrap the call
around a mutex and copy the returned data, but this might keep the
mutex locked for an arbitrary length of time...