chiark / gitweb /
Handle domain names properly, including RFC1035 quoting.
[zone] / sys.lisp
index fc7180e24aacfeb045b0a93a09431052255ca6ea..bcc84339f7d84de44d90e4a7301ca708d855628d 100644 (file)
--- a/sys.lisp
+++ b/sys.lisp
 ;;; along with this program; if not, write to the Free Software Foundation,
 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-(cl:defpackage #:net-sys
-  (:use #:common-lisp)
-  (:export #:gethostname #:resolve-hostname #:canonify-hostname))
-(cl:in-package #:net-sys)
+(cl:in-package #:net)
 
 ;;;--------------------------------------------------------------------------
 ;;; Functions provided.
@@ -34,6 +31,7 @@ (cffi:defcfun gethostname :int
   (name :pointer)
   (len :uint))
 
+(export 'gethostname)
 (defun gethostname ()
   "Return the hostname (not necessarily canonical) of the current host."
 
@@ -44,7 +42,7 @@ (defun gethostname ()
   (sb-unix:unix-gethostname)
 
   #+clisp
-  (unix:get-host-name)
+  (os:uname-nodename (os:uname))
 
   #+ecl
   (cffi:with-foreign-pointer-as-string (buffer 256 len)
@@ -55,6 +53,7 @@ (defun gethostname ()
   #-(or cmu sbcl clisp ecl)
   "<unknown-host>")
 
+(export 'resolve-hostname)
 (defun resolve-hostname (name)
   "Resolve a hostname to an IP address using the DNS, or return nil."
 
@@ -79,6 +78,7 @@ (defun resolve-hostname (name)
   #-(or cmu sbcl clisp ecl)
   nil)
 
+(export 'canonify-hostname)
 (defun canonify-hostname (name)
   "Resolve a hostname to canonical form using the DNS, or return nil."