anchor.diff:          (%push-working-directory-fd dir-fd)))))
   
   (defun cd (path)
  +  "Change the current working directory.
  +
  +This is more or less equivalent to calling `pop-working-directory' and
  +then `push-working-directory'."
     (with-lock-held (*working-directory-lock*)
       (with-fd-scope ()
         (let ((dir-fd (%try-opening-path path)))
  
positive.code: the process."
    (open-retained "." O-RDONLY))
  
  (defvar *working-directory-fds* nil)
  (defvar *working-directory-lock* (make-lock))
  (defun initialize-working-directory-fds ()
    (setf *working-directory-fds* (list (process-working-directory-retained))))
  (on-revival initialize-working-directory-fds)
  
  (defun %current-working-directory-fd ()
    (or (first *working-directory-fds*)
        (fd-autorelease (process-working-directory-retained))))
  
  (defun current-working-directory-fd ()
    (with-lock-held (*working-directory-lock*)
      (%current-working-directory-fd)))
  
  (defun release-history (history)
    (dolist (item history)
      (fd-release item)))
  
  (defun retain-history (history)
    (dolist (item history)
      (fd-retain item)))
  
  (defun preserve-working-directory-history ()
    (with-lock-held (*working-directory-lock*)
      (let* ((fds *working-directory-fds*))
        (retain-history fds)
        fds)))
  
  (defun destroy-preserved-working-directory-history (history)
    (release-history history)
    (values))
  
  (defun call-with-alternate-working-directory-history (history fn)
    (let ((*working-directory-lock* (make-lock))
          (*working-directory-fds* history))
      ;; The history might change once we start executing body.  So,
  
negative.code:           (directory-fd-p fd))))))
  
  (defun directory-fd-p (fd)
    "Returns non-nil if the given fd points at a directory."
    (s-isdir (slot-value (fstat fd) 'st-mode)))
  
  (defgeneric path-invalid-message (condition)
    (:documentation
     "Access the human-readable description of of what is wrong"))
  
  (define-condition path-invalid (error)
    ((message
      :type string
      :initarg :message
      :reader path-invalid-message
      :documentation
      "The human-readable description of what is wrong"))
    (:report (lambda (c s) (format s "Path is invalid.  ~A" (path-invalid-message c))))
    (:documentation
     "A condition that is signaled when a given path string isn't suitable."))
  
  (defun %pop-working-directory ()
    "The non-locking version of `pop-working-directory'."
    (let ((fd (pop *working-directory-fds*)))
      (fd-release fd)
      (values)))
  
  (defun pop-working-directory ()
    "Pop a directory off of the working directory history."
    (with-lock-held (*working-directory-lock*)
      (%pop-working-directory)))
  
  (defun %push-working-directory-fd (fd)
    "The non-locking, fd-centric version of `push-working-directory'."
    (fd-retain fd)
    (push fd *working-directory-fds*))
  
  (defun push-working-directory (path)
    "Push a new directory onto the working directory history."
    (with-lock-held (*working-directory-lock*)
      (with-fd-scope ()
        (let ((dir-fd (%try-opening-path path)))
  