r10227: updates from phoview@lynx
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 27 Dec 2004 03:46:01 +0000 (03:46 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 27 Dec 2004 03:46:01 +0000 (03:46 +0000)
os.lisp
package.lisp

diff --git a/os.lisp b/os.lisp
index cce2a2f..9eece91 100644 (file)
--- 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")))
+  )
+
+
index 8a1c24d..db3f1c7 100644 (file)
    #:run-shell-command-output-stream
    #:delete-directory-and-files
    #:file-size
+   #:getpid
 
    ;; color.lisp
    #:rgb->hsv