chiark
/
gitweb
/
~mdw
/
zone
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
portability: Supply system-specific wossname for CLisp and ECL.
[zone]
/
zone.lisp
diff --git
a/zone.lisp
b/zone.lisp
index 64488c2a0d11f3875462fc00fa505f5c8753b661..37e7499ac3f1c9e0ce6cde9165b343998d19167c 100644
(file)
--- a/
zone.lisp
+++ b/
zone.lisp
@@
-144,9
+144,18
@@
(defstruct (zone (:predicate zonep))
;;;--------------------------------------------------------------------------
;;; Zone defaults. It is intended that scripts override these.
;;;--------------------------------------------------------------------------
;;; Zone defaults. It is intended that scripts override these.
+#+ecl
+(cffi:defcfun gethostname :int
+ (name :pointer)
+ (len :uint))
+
(defvar *default-zone-source*
(let ((hn #+cmu (unix:unix-gethostname)
(defvar *default-zone-source*
(let ((hn #+cmu (unix:unix-gethostname)
- #+clisp (unix:get-host-name)))
+ #+clisp (unix:get-host-name)
+ #+ecl (cffi:with-foreign-pointer-as-string (buffer 256 len)
+ (let ((rc (gethostname buffer len)))
+ (unless (zerop rc)
+ (error "gethostname(2) failed (rc = ~A)." rc))))))
(and hn (concatenate 'string (canonify-hostname hn) ".")))
"The default zone source: the current host's name.")
(and hn (concatenate 'string (canonify-hostname hn) ".")))
"The default zone source: the current host's name.")