Comment 0 for bug 1601927

Revision history for this message
Stas Boukarev (stassats) wrote :

When the other end of a FIFO closes wait-until-fd-usable doesn't exit.
(let ((fifo #p"/tmp/fifo"))
  (unless (probe-file fifo)
    (sb-posix:mkfifo fifo #o644))
  (sb-thread:make-thread
   (lambda ()
     (with-open-file (stream fifo :direction :output :if-exists :overwrite)
       (write-char #\a stream))))
  (with-open-file (stream fifo)
    (print (read-char stream))
    (read-char stream nil :eof)))

returns :EOF on linux but blocks on OSX.

I pushed a workaround that always returns NIL in sysread-may-block-p on darwin for fifo streams.
It breaks timeouts and interrupts but at least allows EOF to be signalled.