0.9.10.39:
[sbcl.git] / src / code / common-os.lisp
1 ;;;; OS interface functions for SBCL common to all target OSes
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 (defvar *software-version* nil)
15
16 (defvar *core-pathname* nil
17   #!+sb-doc
18   "The absolute pathname of the running SBCL core.")
19
20 ;;; if something ever needs to be done differently for one OS, then
21 ;;; split out the different part into per-os functions.
22 (defun os-cold-init-or-reinit ()
23   (/show0 "entering OS-COLD-INIT-OR-REINIT")
24   (setf *software-version* nil)
25   (/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")
26   (setf *default-pathname-defaults*
27         ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up when
28         ;; we call it below:)
29         (make-trivial-default-pathname)
30         *default-pathname-defaults*
31         ;; (final value, constructed using #'NATIVE-PATHNAME:)
32         (native-pathname (sb!unix:posix-getcwd/)))
33   (/show0 "setting *CORE-PATHNAME*")
34   (setf *core-pathname*
35         (merge-pathnames (native-pathname *core-string*)))
36   (/show0 "leaving OS-COLD-INIT-OR-REINIT"))