anchor.diff:  		   *standard-input* out
   		   *debug-io* out
   		   *query-io* out
  -		   *terminal-io* out))
  -	   )
  +		   *terminal-io* out)))
   	  (t 
   	   ;; Parent
   	   (when exit-parent
   	     (exit))
  -	   #-allegro(pclose 0)
  -	   #-allegro(pclose 1)
  -	   #-allegro(pclose 2)
  +	   (pclose 0)
  +	   (pclose 1)
  +	   (pclose 2)
   	   (return-from daemonize pid))))
  +  (when pidfile
  +    (with-open-file (f pidfile :direction :output
  +		       :if-exists :supersede)
  +      (format f "~A~%" (getpid))))
     nil)
  
positive.code: 	   #:daemonize))
  
  (in-package :daemon)
  
  #+allegro
  (eval-when (:load-toplevel :execute)
  
negative.code: 	       (unsigned-byte
  		(or (passwd-uid user)
  		    (error "Unknown userid: ~S" user)))))
  	(gid (typecase group
  	       (string 
  		(group-gid 
  		 (or (getgrnam group)
  		     (error "Unknown groupname: ~S" group))))
  	       (unsigned-byte
  		(if (getgrgid group)
  		    group
  		    (error "Unknown groupid: ~S" group)))))
  	(pid (fork)))
      (cond ((zerop pid)
  	   ;; Child
  	   (umask umask)
  	   (detouch-terminal :input input :output output :error error)
  	   (when gid
  	     (setgid gid))
  	   (when uid 
  	     (setuid uid))
  	   (let* ((out (make-two-way-stream 
  			(make-concatenated-stream)
  			(make-broadcast-stream))))
  