anchor.diff:          #:sb-sys
           #:sb-bsd-sockets)
     (:export #:aio-error
  +           #:aio-error-afd
  +           #:aio-error-code
  +           #:aio-error-where
              #:aio-fd
  +           #:aio-fd-fd
  +           #:aio-fd-socket
  +           #:aio-fd-write-buffer
  +           #:aio-fd-read-handle
  +           #:aio-fd-write-handle
  +           #:aio-fd-read-cb
  +           #:aio-fd-write-cb
  +           #:aio-fd-error-cb
              #:aio-fd-write
              #:aio-fd-close
              #:aio-fd-enable-read-handle
  
positive.code: 
  (defgeneric aio-fd-enable-write-handle (afd)
    (:method ((afd aio-fd))
      (with-slots (fd write-handle) afd
        (when (not write-handle)
          (setf write-handle (add-fd-handler fd :output #'socket-output-cb))))))
  
negative.code: 
  
  (define-condition aio-error (error)
    ((afd
       :initarg :afd
       :initform nil
       :reader aio-error-afd)
     (code
       :initarg :code
       :initform nil
       :reader aio-error-code)
  