-#||
-
-<h2>Contents</h2>
-
-<ol>
-<li> General concepts
-<li> Methods applicable to all <a href="#socket">sockets</a>
-<li> <a href="#sockopt">Socket Options</a>
-<li> Methods applicable to a particular subclass
-<ol>
-<li> <a href="#internet">INET-SOCKET</a> - Internet Protocol (TCP, UDP, raw) sockets
-<li> Methods on <a href="#LOCAL-SOCKET">LOCAL-SOCKET</a> - Local-domain sockets
-</ol>
-<li> <a href="#name-service">Name resolution</a> (DNS, /etc/hosts, &c)
-</ol>
-
-<h2>General concepts</h2>
-
-<p>Most of the functions are modelled on the BSD socket API. BSD sockets
-are widely supported, portably <i>("portable" by Unix standards, at least)</i>
-available on a variety of systems, and documented. There are some
-differences in approach where we have taken advantage of some of the more useful features of Common Lisp - briefly
-
-<ul>
-<li> Where the C API would typically return -1 and set errno, we
-signal an error. All the errors are subclasses of SOCKET-CONDITION
-and generally correspond one for one with possible <tt>errno</tt> values
-
-<li> We use multiple return values in many places where the C API would use
-pass-by-reference values
-
-<li> We can often avoid supplying an explicit <i>length</i> argument to
-functions because we already know how long the argument is.
-
-<li> IP addresses and ports are represented in slightly friendlier fashion
-than "network-endian integers". See the section on <a href="#internet"
->Internet domain</a> sockets for details.
-</ul>
-
-
-|#
-
-(in-package :sb-bsd-sockets)
-
-(defmethod asdf:hyperdocumentation
- ((package (eql #.*package*)) symbol kind)
- (declare (ignore kind))
- (format nil "file://~A#~A"
- #.(namestring
- (merge-pathnames "index.html"
- (or *load-pathname* *compile-file-pathname*)))
- symbol))
+;;; gethostbyname/gethostbyaddr are generally not thread safe. POSIX
+;;; 1003.1-2003 defines an alternative API, which is specified in the
+;;; RFC to be thread-safe. If it seems to be available, use it.
+;;;
+;;; Unfortunately the manual page claims that these functions are not
+;;; thread-safe on OS X, but they probably can't be any worse than
+;;; gethostbyname and gethostbyaddr.
+;;;
+;;; CLH: getaddrinfo seems to be broken is broken on x86-64/darwin
+#-(and x86-64 darwin)
+(let ((addr (sb-alien::find-dynamic-foreign-symbol-address "getaddrinfo")))
+ (when addr
+ (pushnew :sb-bsd-sockets-addrinfo *features*)))