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.
When the other end of a FIFO closes wait-until- fd-usable doesn't exit. posix:mkfifo fifo #o644)) make-thread open-file (stream fifo :direction :output :if-exists :overwrite)
(let ((fifo #p"/tmp/fifo"))
(unless (probe-file fifo)
(sb-
(sb-thread:
(lambda ()
(with-
(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.