Index: /trunk/ccl/level-1/l1-processes.lisp
===================================================================
--- /trunk/ccl/level-1/l1-processes.lisp	(revision 6193)
+++ /trunk/ccl/level-1/l1-processes.lisp	(revision 6194)
@@ -136,6 +136,7 @@
                          :initarg :allocation-quantum
                          :reader process-allocation-quantum
-                         :type (satisfies valid-allocation-quantum-p)))
-  
+                         :type (satisfies valid-allocation-quantum-p))
+     (dribble-stream :initform nil)
+     (dribble-saved-terminal-io :initform nil))
   (:primary-p t))
 
@@ -185,5 +186,5 @@
 
 
-(defglobal *initial-process*
+(defstatic *initial-process*
     (let* ((p (make-process
 	       "Initial"
@@ -197,5 +198,5 @@
   "Bound in each process, to that process itself.")
 
-(defglobal *interactive-abort-process* *initial-process*)
+(defstatic *interactive-abort-process* *initial-process*)
 
 
@@ -383,5 +384,5 @@
 		  (if defenv
 		    (eq :global (%cdr (assq s (defenv.specials defenv)))))))
-      (error "~s not defined with ~s" s 'defglobal))
+      (error "~s not defined with ~s" s 'defstatic))
     s))
 
@@ -633,2 +634,27 @@
   (when (eq p *current-process*)
     (quit)))
+
+(defmethod process-stop-dribbling ((p process))
+  (with-slots (dribble-stream dribble-saved-terminal-io) p
+    (when dribble-stream
+      (close dribble-stream)
+      (setq dribble-stream nil))
+    (when dribble-saved-terminal-io
+      (setq *terminal-io* dribble-saved-terminal-io
+            dribble-saved-terminal-io nil))))
+
+(defmethod process-dribble ((p process) path)
+  (with-slots (dribble-stream dribble-saved-terminal-io) p
+    (process-stop-dribbling p)
+    (when path
+      (let* ((in (two-way-stream-input-stream *terminal-io*))
+             (out (two-way-stream-output-stream *terminal-io*))
+             (f (open path :direction :output :if-exists :append 
+                      :if-does-not-exist :create)))
+        (without-interrupts
+         (setq dribble-stream f
+               dribble-saved-terminal-io *terminal-io*
+               *terminal-io* (make-echoing-two-way-stream
+                              (make-echo-stream in f)
+                              (make-broadcast-stream out f)))))
+      path)))
