about summary refs log blame commit diff stats
path: root/sysdep.lsp
blob: e12cc9acc673378c757bf74190ef042f4df51685 (plain) (tree)
























                                                                
#!/home/dbane/openlisp-10.9.0/uxlisp -shell
(defpackage #:sysdep
  (:use #:openlisp)
  (:export
   #:get-ieee-node-identifier))
(in-package #:sysdep)
(defglobal *inited* nil)
(defglobal *saved-node* nil)
(defun error-handler (condition)
   (let ((seed (get-random-info)))
        (setf (elt seed 0) (logior (elt seed 0) 1))
        (setq *saved-node* (copy-seq seed))
        (with-open-output-file (outstream "nodeid")
             (format outstream "~S" *saved-node*))))
(defun get-ieee-node-identifier ()
   (if (not *inited*)
       (progn (with-handler #'error-handler
                 (with-open-input-file (instream "nodeid")
                      (read instream)))
              (setq *inited* t)))
   *saved-node*)
(provide "sysdep")
(defun main ()
   (format (standard-output) "~A~%" (get-ieee-node-identifier)))
(main)