]> git.sesse.net Git - stockfish/commit
Set unbuffered I/O also for C standard library
authorMarco Costalba <mcostalba@gmail.com>
Tue, 11 Jan 2011 15:22:12 +0000 (16:22 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 11 Jan 2011 17:58:56 +0000 (18:58 +0100)
commitd4b92ae9a094e1b388e3d70789a0db9a9c69cbdf
tree6fdf6c59577df0c00101f15be4cfbcc380f8d87c
parent611a29f7675d3e5dc7e5e2b63cca9274eae05578
Set unbuffered I/O also for C standard library

In input_available() we use function select(), so
we have to set as unbuffered also C library I/O
functions otherwise we can miss some input.

For instance in case GUI sends "go infinite\nstop\n" we
parse the "go infinite" but then input_available() under Linux
is unable to detect that we still have "stop" to be processed.

This is because "select" uses file descriptors instead of file
pointers. So it cannot know about the buffer associated to a file
pointer.

This patch, by BB+, should fix the problem.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/main.cpp