anchor.diff:  (defcfun (%open "open")
       :int32
     (path :string)
  -  (flags :int32)
  -  (mode :int32))
  +  (flags :int32) ;; 64 == o_creat|o_rdwr
  +  (mode :int32)) ;; 438 == rw|rw|rw
   
   (defcfun (%close "close")
       :int32
  
positive.code:     (setf (mem-ref b :uint8) 0)
      (%write fd b 1)))
  
  (defcfun (%flock "flock"))
  
  ;; need to work out the size of each field
  (defcstruct stat-info
    (dev :uint32)
    (inode :uint32)
    (mode :uint32)
    (nlink :uint32)
    (uid :uint32)
    (gid :uint32)
    (dev :uint32)
    (size size-t)
    (blksize size-t)
    (blkcnt size-t)
    (atime size-t)
    (mtime size-t)
    (ctime size-t))
  
  (defcfun (%fstat "fstat")
      :int32
    (fd :int32)
    (stat :pointer))
  
  (defun get-file-size (fd)
    (with-foreign-object (stat '(:struct stat-info))
      (%fstat fd stat)
      (foreign-slot-value stat '(:struct stat-info) 'size)))
  
  (defstruct mapping 
    fd 
  
negative.code: 	(when (null-pointer-p ptr)
  	  (get-last-error))
  	(setf (mapping-mhandle mapping) mhandle
  	      (mapping-ptr mapping) ptr
  	      (mapping-size mapping) size))))
    mapping)
  
  (defun flush-buffers (mapping)
    "Ensure changes to the file mapping are written to disk."
    (%flush-file-buffers (mapping-fhandle mapping)))
  
  ;; we lock the first byte and rely on co-operative locking
  