X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=os.lisp;h=9eece913162b90f4b8c9bf9cab0c84749fdcd3b4;hp=cce2a2f99fe80f7b221487d08d01ad1f2a20a3c1;hb=86a868a95313178cdc7a83d35856ccf5c2cf315f;hpb=e96b017d2a09ffd9c9279cb4c2341c53f0581022 diff --git a/os.lisp b/os.lisp index cce2a2f..9eece91 100644 --- a/os.lisp +++ b/os.lisp @@ -159,3 +159,21 @@ returns (VALUES output-string pid)" #-allegro (with-open-file (in file :direction :input) (file-length in)))) + +(defun getpid () + "Return the PID of the lisp process." + #+allegro (excl::getpid) + #+(and lispworks win32) (win32:get-current-process-id) + #+(and lispworks (not win32)) (system::getpid) + #+sbcl (sb-posix:getpid) + #+cmu (unix:unix-getpid) + #+openmcl (ccl:getpid) + #+(and clisp unix) (system::program-id) + #+(and clisp win32) (cond ((find-package :win32) + (funcall (find-symbol "GetCurrentProcessId" + :win32))) + (t + (system::getenv "PID"))) + ) + +