[Ecls-list] gethostname, machine-instance & friends

Thibault Langlois tl at di.fc.ul.pt
Mon Jun 25 18:32:09 UTC 2007


Hello,

I would like to have access to the name of the machine, something like
SBCL's (sb-unix:unix-gethostname). Is there an equivalent for ECL ?

If there is one, maybe it could be used in the definition of the
MACHINE-INSTANCE function.

With a freshly build ECL we get:
 CL-USER> (machine-instance)
"x86_64"
CL-USER> (machine-type)
"X86_64"
CL-USER> (machine-version)
"unknown"

A quick and dirty linux-only solution may be:

(defun gethostname ()
   (with-open-file (f "/proc/sys/kernel/hostname")
        (read f nil nil))

Any suggestion ?

Thibault


-- 
Thibault Langlois
FCUL / DI




More information about the ecl-devel mailing list