anchor.diff:    ;; the file is now created and the correct size 
     (let ((fd (with-foreign-string (s path)
   	      (%open s 
  -		     64 ;; o_creat|o_rdwr
  -		     438)))) ;; rw|rw|rw
  +		     2 ;; o_rdwr
  +		     600)))) ;; rw
       (when (< fd 0)
  -      (error "failed to open"))
  +      (get-last-error))
       (let ((ptr (%mmap (null-pointer) 
   		      size 
   		      3 ;; prot_read | prot_write
   		      1 ;; map_shared
   		      fd 
   		      0)))
  -      (when (null-pointer-p ptr)
  +      (when (invalid-pointer-p ptr)
   	(%close fd)
  -	(error "failed to mmap"))
  +	(get-last-error))
         (make-mapping :fd fd
   		    :ptr ptr
   		    :size size))))
  
positive.code:   (fd :int32)
    (op :int32))
  
  (defstruct mapping 
    fd 
    ptr
    size
    (lock (bt:make-lock)))
  
  (defun open-mapping (path &key size)
    "Opens the file named by PATH and maps it into memory. 
  
negative.code: 
  (defun remap (mapping size)
    "Remap the file. SIZE should be the new size."
    (%munmap (mapping-ptr mapping)
  	   (mapping-size mapping))
    ;; write a byte at size
    (when (> size (mapping-size mapping))
      (write-zero-at (mapping-fd mapping) size))    
  