Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Hostname/Common-Lisp/hostname-1.lisp
Normal file
4
Task/Hostname/Common-Lisp/hostname-1.lisp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(defun get-host-name ()
|
||||
#+(or sbcl ccl) (machine-instance)
|
||||
#+clisp (let ((s (machine-instance))) (subseq s 0 (position #\Space s)))
|
||||
#-(or sbcl ccl clisp) (error "get-host-name not implemented"))
|
||||
8
Task/Hostname/Common-Lisp/hostname-2.lisp
Normal file
8
Task/Hostname/Common-Lisp/hostname-2.lisp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(cffi:defcfun ("gethostname" c-gethostname) :int
|
||||
(buf :pointer) (len :unsigned-long))
|
||||
|
||||
(defun get-hostname ()
|
||||
(cffi:with-foreign-object (buf :char 256)
|
||||
(unless (zerop (c-gethostname buf 256))
|
||||
(error "Can't get hostname"))
|
||||
(values (cffi:foreign-string-to-lisp buf))))
|
||||
2
Task/Hostname/Common-Lisp/hostname-3.lisp
Normal file
2
Task/Hostname/Common-Lisp/hostname-3.lisp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
BOA> (get-hostname)
|
||||
"aurora"
|
||||
Loading…
Add table
Add a link
Reference in a new issue