     (let ((index (c-write (fileno port) bv 0 length)))
       (if (&lt; index length)
	   (let ((fd (port-&gt;fdes port)))
	     (a-sync-write-watch! resume
				  fd
				  (lambda (status)
				    (catch #t
				      (lambda ()
					(if (eq? status 'excpt)
					    #f
					    (begin
					      (set! index (+ index (c-write fd
									    bv
									    index
									    (- length index))))
					      (if (&lt; index length)
						  'more
						  #t))))
				      (lambda args
					(release-port-handle p