about summary refs log tree commit diff stats
path: root/sysdep.lsp
blob: e12cc9acc673378c757bf74190ef042f4df51685 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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)