1.0.48.7: add FD-STREAM-FD-TYPE, use it to decide when to poll the fd
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 10 May 2011 20:05:25 +0000 (20:05 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 10 May 2011 20:05:25 +0000 (20:05 +0000)
commitb67c2d7522c0b73a18e316faa2b81d7c8b187706
treed308832c3437c37c74053d2cb4b48ecaed429f43
parentfe27d4f190a9079834bb794e7af6e330d95cbad9
1.0.48.7: add FD-STREAM-FD-TYPE, use it to decide when to poll the fd

  1.0.42.43 introduced a regression that caused reads from non-regular files
  to potentially block in an uninterruptible state, as WAIT-UNTIL-FD-USABLE
  started being called only when there was a timeout or events to serve.

  This was a win for regular files, because filling the input buffer then
  required one syscall less.

  ...but since uninterruptible blocking reads aren't fun for anyone, let's
  make things a bit smarter:

  * When creating an FD-STREAM, use fstat() to get the type of the fd, and
    store a keyword describing it in the FD-STREAM.

  * REFILL-INPUT-BUFFER now calls SYSREAD-MAY-BLOCK-P always if the file
    anything but :REGULAR -- so pipes and sockets and whatnot get their
    select() calls, and a read from a stream to one can no longer cause
    SBCL to hang.
NEWS
package-data-list.lisp-expr
src/code/fd-stream.lisp
src/code/unix.lisp
tests/run-program.impure.lisp
version.lisp-expr