[freetds] Strange TODO

James K. Lowden jklowden at schemamania.org
Fri Jul 25 10:18:55 EDT 2008

Thus spake Frediano: 

> How to fix all these problems?? 
> - we have no safe source for servent_data (private libc header is not
> installed).  - we can implement a thread-safe getservbyname locking
> _servent_mutex directly and call getservbyname_r (not that clean) and
> endservent_r (avoid leaks). - use getaddrinfo, is it thread-safe under
> NetBSD ??

It turns out we're going about this all wrong.  Instead of getservbyname_r
et al., we should be using getnameinfo/getaddrinfo.  Those should be
threadsafe on any platform, and are standard.  

Do you think it's feasible to abandon getservbyname_r?  Do we support any
platform on which getservbyname_r is implemented but getaddrinfo is not? 


Begin forwarded message:

Date: Wed, 23 Jul 2008 19:04:35 +0000 (UTC)
From: christos at astron.com (Christos Zoulas)
To: netbsd-users at netbsd.org
Subject: Re: getservbyname_r

In article <20080723144255.3b05284b.jklowden at schemamania.org>,
James K. Lowden <netbsd-users at NetBSD.org> wrote:
>What is the status of getservbyname_r?  There's no man page, but it seems
>to be referenced in netdb.c.  
>I'm trying to determine if FreeTDS can be run in threadsafe mode on
>NetBSD.  It requires the usual suite of reentrant networking functions.  

It is not documented because it is an ugly api and non-standard. Why
don't you use getnameinfo/getaddrinfo?


More information about the FreeTDS mailing list