1 ;;;; OS interface functions for SBCL under Win32.
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 #!-win32 (error "missing :WIN32 feature")
18 (defun software-type ()
20 "Return a string describing the supporting software."
23 (defvar *software-version* nil)
25 (defun software-version ()
27 "Return a string describing version of the supporting software, or NIL
29 nil ;; FIXME: Implement.
30 #+nil(or *software-version*
31 (setf *software-version*
32 (string-trim '(#\newline)
33 (with-output-to-string (stream)
34 (sb!ext:run-program "/bin/uname" `("-r")
37 (defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
38 (/show0 "entering win32-os.lisp OS-COLD-INIT-OR-REINIT")
39 (setf *software-version* nil)
40 (/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")
41 (setf *default-pathname-defaults*
42 ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up when
44 (make-trivial-default-pathname)
45 *default-pathname-defaults*
46 ;; (final value, constructed using #'NATIVE-PATHNAME:)
47 (native-pathname (sb!unix:posix-getcwd/)))
48 (/show0 "leaving linux-os.lisp OS-COLD-INIT-OR-REINIT"))
50 ;;; Return system time, user time and number of page faults.
51 (defun get-system-info ()
52 #+nil (multiple-value-bind
53 (err? utime stime maxrss ixrss idrss isrss minflt majflt)
54 (sb!unix:unix-getrusage sb!unix:rusage_self)
55 (declare (ignore maxrss ixrss idrss isrss minflt))
56 (unless err? ; FIXME: nonmnemonic (reversed) name for ERR?
57 (error "Unix system call getrusage failed: ~A." (strerror utime)))
58 (values utime stime majflt)))
60 ;;; Return the system page size.
61 (defun get-page-size ()
62 ;; probably should call getpagesize()
63 ;; FIXME: Or we could just get rid of this, since the uses of it look