I noticed this while stracing an application: given a fully
buffered bidirectional binary stream, if there is data in a
buffer waiting to be read then sbcl outputs two lseek() system
calls for each element output. Compile (defun socket-connect
(port host) (sb-bsd-sockets:socket-make-stream (let ((s (make-
instance 'sb-bsd-sockets:inet-socket :type :stream :protocol
:tcp)) (num (car (sb-bsd-sockets:host-ent-addresses (sb-bsd-
sockets:get-host-by-name host))))) (sb-bsd-sockets:socket-
connect s num port) s) :buffering :full :element-type
'(unsigned-byte 8) :input t :output t)) then attach strace, or
whatever system call tracer is available on your platform, and
evaluate the following form: (let ((f (socket-connect 119
"localhost"))) (prog1 (read-byte f) (write-sequence (map 'vector
#'char-code (format nil "help~%")) f) (sleep 4) (close f))) I
see ten lseek() calls. This appears to be due to the (file-
position stream (file-position stream)) changes in which are
supposed to deconfuse bidi streams about their file-po