Hi Ulrich,
On Friday 28 September 2007 18:34, Ulrich Drepper wrote:
Tangential question: do you have any idea how userspace can
safely do nonblocking read or write on a potentially-shared fd?
IIUC, currently it cannot be done without races:
old_flags = fcntl(fd, F_GETFL);
...other process may change flags!...
fcntl(fd, F_SETFL, old_flags | O_NONBLOCK);
read(fd, ...)
...other process may see flags changed under its feet!...
fcntl(fd, F_SETFL, old_flags);
Can this be fixed?
--
vda
-