X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=os.lisp;h=805b10c3c5275baa529601ad4350c2e37a55c38c;hp=cce2a2f99fe80f7b221487d08d01ad1f2a20a3c1;hb=6d291d79b73438efb15fca954cc00b43fde368a8;hpb=6ab952c17ac4beec2f239dda5e8cf062fc3824d2 diff --git a/os.lisp b/os.lisp index cce2a2f..805b10c 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"))) + ) + +