X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-bsd-sockets%2Fname-service.lisp;h=ff9279bfbcccff5f6f28f94628e179e89936cbc2;hb=127fd3d2fb843c6bb7ad0763e143d81877e760e8;hp=dfa826b1681eee6ae3ae0daff63c235ff53e65cd;hpb=27763fafd1b170518ac2e85b9344fdddddcfd7c5;p=sbcl.git diff --git a/contrib/sb-bsd-sockets/name-service.lisp b/contrib/sb-bsd-sockets/name-service.lisp index dfa826b..ff9279b 100644 --- a/contrib/sb-bsd-sockets/name-service.lisp +++ b/contrib/sb-bsd-sockets/name-service.lisp @@ -1,16 +1,15 @@ (in-package :sb-bsd-sockets) (defclass host-ent () - ;; Unfortunately the docstring generator can't currently create. - ((name :initarg :name :accessor host-ent-name + ((name :initarg :name :reader host-ent-name :documentation "The name of the host") ;; Deliberately not documented, since this isn't very useful, ;; and the data isn't available when using getaddrinfo(). Unfortunately ;; it is exported. - (aliases :initarg :aliases :accessor host-ent-aliases) + (aliases :initarg :aliases :reader host-ent-aliases) ;; presently always AF_INET. Not exported. - (address-type :initarg :type :accessor host-ent-address-type) - (addresses :initarg :addresses :accessor host-ent-addresses + (address-type :initarg :type :reader host-ent-address-type) + (addresses :initarg :addresses :reader host-ent-addresses :documentation "A list of addresses for this host.")) (:documentation "This class represents the results of an address lookup.")) @@ -34,8 +33,17 @@ until (sb-alien:null-alien ad) collect (ecase (sockint::hostent-type h) (#.sockint::af-inet + ;; CLH: Work around x86-64 darwin bug here. + ;; The length is reported as 8, when it should be 4. + ;; FIXME: this is rumored to be fix in 10.5 + #+(and darwin x86-64) + (progn + (assert (or (= length 4) (= length 8))) + (naturalize-unsigned-byte-8-array ad 4)) + #-(and darwin x86-64) + (progn (assert (= length 4)) - (naturalize-unsigned-byte-8-array ad length)) + (naturalize-unsigned-byte-8-array ad length))) #-win32 (#.sockint::af-local (sb-alien:cast ad sb-alien:c-string)))))) @@ -101,7 +109,7 @@ weird stuff - see gethostbyname(3) or getaddrinfo(3) for the details." ;; The same effective result can be multiple time ;; in the list, with different socktypes. Only record ;; each address once. - (setf (host-ent-addresses host-ent) + (setf (slot-value host-ent 'addresses) (adjoin (naturalize-unsigned-byte-8-array address 4) (host-ent-addresses host-ent) @@ -222,7 +230,7 @@ GET-NAME-SERVICE-ERRNO") no-recovery-error) (define-name-service-condition sockint::NO-ADDRESS ;; Also defined as NO-DATA, with the same value - sockint::EAI-NODATA + #-freebsd sockint::EAI-NODATA #+freebsd nil no-address-error) (defun condition-for-name-service-errno (err)