[usocket-cvs] r240 - usocket/trunk/backend

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Wed May 16 23:06:11 UTC 2007


Author: ehuelsmann
Date: Wed May 16 19:06:09 2007
New Revision: 240

Modified:
   usocket/trunk/backend/sbcl.lisp
Log:
Add cl-smtp 'requirement': get-host-name (ECL backend).

Modified: usocket/trunk/backend/sbcl.lisp
==============================================================================
--- usocket/trunk/backend/sbcl.lisp	(original)
+++ usocket/trunk/backend/sbcl.lisp	Wed May 16 19:06:09 2007
@@ -35,6 +35,26 @@
            (cast buf sb-alien:c-string))))))
 
 
+#+ecl
+(progn
+  (ffi:clines
+   #-:wsock
+   "#include <sys/socket.h>"
+   #+:wsock
+   "#include <winsock2.h>"
+   )
+
+  (defun get-host-name ()
+    (ffi:c-inline
+     () () t
+     "{ char buf[256];
+        int r = gethostname(&buf,256);
+
+        if (r == 0)
+           @(return) = make_simple_base_string(&buf);
+        else
+           @(return) = Cnil;
+      }")))
 
 (defun map-socket-error (sock-err)
   (map-errno-error (sb-bsd-sockets::socket-error-errno sock-err)))



More information about the usocket-cvs mailing list