sendfile repro attempt added by teiresias on Tue Jun 14 01:27:19 2022

exec csi -s "$0" "$@"
;; Stupid little attempt to reproduce the sendfile thing.
;; The other end is a server that just discards data:
;; tcpserver 3456 redirfd -w 1 /dev/null cat
;; (uses ucspi-tcp and execline packages, you could probably just use discard
;; from xinetd and change the port number).
;; Call client with E.G.,
;; ./repro.scm 13233
(import brev sendfile simple-loops (chicken tcp))

  (c write-string
     (make-string (string->number (car (command-line-arguments))) #\a) #f))
 (receive (inp outp)
     (tcp-connect "" 3456)
   (close-input-port inp)
   (call-with-input-file "/tmp/junk" (fn (sendfile x outp)))
   (close-output-port outp)
   ;; This hangs if we try to connect too fast, gods know why.
   (sleep 1)))