X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/zone/blobdiff_plain/8e7c1366598806dff2b2e4fb2016efb5a78f42ec..bd54e5099ea4282d3fdb094d0516a09006b08b26:/sys.lisp diff --git a/sys.lisp b/sys.lisp index fc7180e..bcc8433 100644 --- a/sys.lisp +++ b/sys.lisp @@ -21,10 +21,7 @@ ;;; 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) "") +(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."