0.9.16.35:
[sbcl.git] / src / code / win32-os.lisp
1 ;;;; OS interface functions for SBCL under Win32.
2
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.
11
12 (in-package "SB!SYS")
13
14 ;;; Check that target machine features are set up consistently with
15 ;;; this file.
16 #!-win32 (error "missing :WIN32 feature")
17
18 (defun software-type ()
19   #!+sb-doc
20   "Return a string describing the supporting software."
21   (values "Win32"))
22
23 (defun software-version ()
24   #!+sb-doc
25   "Return a string describing version of the supporting software, or NIL
26   if not available."
27   (or *software-version*
28       (setf *software-version*
29             (multiple-value-bind (MajorVersion MinorVersion BuildNumber PlatformId CSDVersion)
30                 (sb!win32:get-version-ex)
31               (declare (ignore PlatformId))
32               (format nil (if (zerop (length CSDVersion)) "~A.~A.~A" "~A.~A.~A (~A)")
33                       MajorVersion MinorVersion BuildNumber CSDVersion)))))
34
35 ;;; Return user time, system time, and number of page faults.
36 (defun get-system-info ()
37   ;; FIXME: number of page faults is always zero
38   (multiple-value-bind (creation-time exit-time kernel-time user-time)
39       (sb!win32:get-process-times)
40     (declare (ignore creation-time exit-time))
41     (values (floor user-time 10) (floor kernel-time 10) 0)))
42
43 ;;; Return the system page size.
44 (defun get-page-size ()
45   ;; probably should call getpagesize()
46   ;; FIXME: Or we could just get rid of this, since the uses of it look
47   ;; disposable.
48   4096)