X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Flinux-os.lisp;h=52610c7cbc004d022a8659ad2764a5ccf46eb3ba;hb=80304981972c91c1b3f3fca75f36dacf1fecf307;hp=8d7abc0c2315a692829fa348e8dae2d6e9ab732b;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/linux-os.lisp b/src/code/linux-os.lisp index 8d7abc0..52610c7 100644 --- a/src/code/linux-os.lisp +++ b/src/code/linux-os.lisp @@ -11,10 +11,8 @@ (in-package "SB!SYS") -(file-comment - "$Header$") - -;;; Check that target machine features are set up consistently with this file. +;;; Check that target machine features are set up consistently with +;;; this file. #!-linux (error "missing :LINUX feature") (defun software-type () @@ -22,28 +20,31 @@ "Return a string describing the supporting software." (values "Linux")) +(defvar *software-version* nil) + (defun software-version () #!+sb-doc "Return a string describing version of the supporting software, or NIL if not available." - ;; The old CMU CL code is NILed out here. If we wanted to do this, we should - ;; probably either use "/bin/uname -r", but since in any case we don't have - ;; RUN-PROGRAM working right now (sbcl-0.6.4), for now we just punt, - ;; returning NIL. - #+nil - (string-trim '(#\newline) - (with-output-to-string (stream) - (run-program "/usr/cs/etc/version" ; Site dependent??? - nil :output stream))) - nil) + (or *software-version* + (setf *software-version* + (string-trim '(#\newline) + (with-output-to-string (stream) + (sb!ext:run-program "/bin/uname" `("-r") + :output stream)))))) -;;; OS-COLD-INIT-OR-REINIT initializes our operating-system interface. -;;; It sets the values of the global port variables to what they -;;; should be and calls the functions that set up the argument blocks -;;; for the server interfaces. (defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here - #!+sparc ;; Can't use #x20000000 thru #xDFFFFFFF, but mach tries to let us. - (sb!sys:allocate-system-memory-at (sb!sys:int-sap #x20000000) #xc0000000)) + (/show "entering linux-os.lisp OS-COLD-INIT-OR-REINIT") + (setf *software-version* nil) + (/show "setting *DEFAULT-PATHNAME-DEFAULTS*") + (setf *default-pathname-defaults* + ;; (temporary value, so that #'PATHNAME won't blow up when + ;; we call it below:) + (make-trivial-default-pathname) + *default-pathname-defaults* + ;; (final value, constructed using #'PATHNAME:) + (pathname (sb!unix:posix-getcwd/))) + (/show "leaving linux-os.lisp OS-COLD-INIT-OR-REINIT")) ;;; Return system time, user time and number of page faults. (defun get-system-info () @@ -52,9 +53,7 @@ (sb!unix:unix-getrusage sb!unix:rusage_self) (declare (ignore maxrss ixrss idrss isrss minflt)) (unless err? ; FIXME: nonmnemonic (reversed) name for ERR? - (error "Unix system call getrusage failed: ~A." - (sb!unix:get-unix-error-msg utime))) - + (error "Unix system call getrusage failed: ~A." (strerror utime))) (values utime stime majflt))) ;;; Return the system page size.