0.7.8.56:
[sbcl/lichteblau.git] / src / code / osf1-os.lisp
blob496e6b248bcb6cb951b758764f56537d943c3edd
1 ;;;; OS interface functions for CMU CL under OSF/1
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB!SYS")
14 ;;; Check that target machine features are set up consistently with
15 ;;; this file.
16 #!-osf1 (error "missing :OSF1 feature")
18 (defun software-type ()
19 #!+sb-doc
20 "Return a string describing the supporting software."
21 (values "OSF/1"))
23 (defvar *software-version* nil)
25 (defun software-version ()
26 #!+sb-doc
27 "Return a string describing version of the supporting software, or NIL
28 if not available."
29 (or *software-version*
30 (setf *software-version*
31 (string-trim '(#\newline)
32 (with-output-to-string (stream)
33 (sb!ext:run-program "/bin/uname" `("-r")
34 :output stream))))))
36 (defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
37 (/show "entering osf1-os.lisp OS-COLD-INIT-OR-REINIT")
38 (setf *software-version* nil)
39 (/show "setting *DEFAULT-PATHNAME-DEFAULTS*")
40 (setf *default-pathname-defaults*
41 ;; (temporary value, so that #'PATHNAME won't blow up when
42 ;; we call it below:)
43 (make-trivial-default-pathname)
44 *default-pathname-defaults*
45 ;; (final value, constructed using #'PATHNAME:)
46 (pathname (sb!unix:posix-getcwd/)))
47 (/show "leaving osf1-os.lisp OS-COLD-INIT-OR-REINIT"))
49 ;;; Return system time, user time and number of page faults.
50 (defun get-system-info ()
51 (multiple-value-bind
52 (err? utime stime maxrss ixrss idrss isrss minflt majflt)
53 (sb!unix:unix-getrusage sb!unix:rusage_self)
54 (declare (ignore maxrss ixrss idrss isrss minflt))
55 (unless err? ; FIXME: nonmnemonic (reversed) name for ERR?
56 (error "Unix system call getrusage failed: ~A." (strerror utime)))
57 (values utime stime majflt)))
59 ;;; Return the system page size.
60 (defun get-page-size ()
61 ;; probably should call getpagesize()
62 ;; FIXME: Or we could just get rid of this, since the uses of it look
63 ;; disposable.
64 4096)