[Openmcl-devel] read-char-no-hang can hang
ron at flownet.com
Thu Nov 15 07:55:44 UTC 2012
When reading from /dev/some-slow-serial-device, read-char-no-hang can hang. I think this is because LISTEN is defined to return NIL only on EOF, and the OS doesn't report the absence of input characters as EOF. I tried to work around this by being devilishly clever and setting the underlying file descriptor to be non-blocking and using the FFI to call read() directly, but that seems to leave Lisp very confused:
? (read-char f)
> Error: Expected newpos to be 3, fd is at 5
> While executing: CCL::IO-FILE-IOBLOCK-ADVANCE, in process Listener(6).
Is there a way to reliably tell whether or not a call to read-char will hang on a serial device stream?
More information about the Openmcl-devel