X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcommon-os.lisp;h=7de4d4632da54493a6f8b83b160dc15c59f047d7;hb=672b2f6cb751566526c7f3bb3de6b7d8424760e2;hp=9846ed696715e0bb371996c881a6ef0b81edc571;hpb=b0a7abdf2bd6f2d66fcce97196024cdb0e1a1886;p=sbcl.git diff --git a/src/code/common-os.lisp b/src/code/common-os.lisp index 9846ed6..7de4d46 100644 --- a/src/code/common-os.lisp +++ b/src/code/common-os.lisp @@ -17,9 +17,21 @@ #!+sb-doc "The absolute pathname of the running SBCL core.") +(sb!alien:define-alien-variable ("posix_argv" *native-posix-argv*) (* (* char))) +(sb!alien:define-alien-variable ("core_string" *native-core-string*) (* char)) + ;;; if something ever needs to be done differently for one OS, then ;;; split out the different part into per-os functions. (defun os-cold-init-or-reinit () + (/show0 "setting *CORE-STRING*") + (setf *core-string* + (sb!alien:cast *native-core-string* sb!alien:c-string)) + (/show0 "setting *POSIX-ARGV*") + (setf sb!ext:*posix-argv* + (loop for i from 0 + for arg = (sb!alien:deref *native-posix-argv* i) + until (sb!alien:null-alien arg) + collect (sb!alien:cast arg sb!alien:c-string))) (/show0 "entering OS-COLD-INIT-OR-REINIT") (setf *software-version* nil) (/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")