1 ;;;; OS interface functions for CMU CL under Linux
3 ;;;; This software is part of the SBCL system. See the README file for
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.
14 ;;; Check that target machine features are set up consistently with
16 #!-linux (error "missing :LINUX feature")
18 (defun software-type ()
20 "Return a string describing the supporting software."
23 (defun software-version ()
25 "Return a string describing version of the supporting software, or NIL
27 ;; The old CMU CL code is NILed out here. If we wanted to do this, we should
28 ;; probably either use "/bin/uname -r", but since in any case we don't have
29 ;; RUN-PROGRAM working right now (sbcl-0.6.4), for now we just punt,
32 (string-trim '(#\newline)
33 (with-output-to-string (stream)
34 (run-program "/usr/cs/etc/version" ; Site dependent???
38 ;;; OS-COLD-INIT-OR-REINIT initializes our operating-system interface.
39 ;;; It sets the values of the global port variables to what they
40 ;;; should be and calls the functions that set up the argument blocks
41 ;;; for the server interfaces.
42 (defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
43 #!+sparc ;; Can't use #x20000000 thru #xDFFFFFFF, but mach tries to let us.
44 (sb!sys:allocate-system-memory-at (sb!sys:int-sap #x20000000) #xc0000000))
46 ;;; Return system time, user time and number of page faults.
47 (defun get-system-info ()
49 (err? utime stime maxrss ixrss idrss isrss minflt majflt)
50 (sb!unix:unix-getrusage sb!unix:rusage_self)
51 (declare (ignore maxrss ixrss idrss isrss minflt))
52 (unless err? ; FIXME: nonmnemonic (reversed) name for ERR?
53 (error "Unix system call getrusage failed: ~A."
54 (sb!unix:get-unix-error-msg utime)))
56 (values utime stime majflt)))
58 ;;; Return the system page size.
59 (defun get-page-size ()
60 ;; probably should call getpagesize()
61 ;; FIXME: Or we could just get rid of this, since the uses of it look