mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
pipefs: make poll better
This commit is contained in:
@@ -73,7 +73,9 @@ static int internalpoll(vnode_t *node, polldata_t *data, int events) {
|
|||||||
events |= POLLERR;
|
events |= POLLERR;
|
||||||
if (pipenode->readers == 0)
|
if (pipenode->readers == 0)
|
||||||
revents |= POLLERR;
|
revents |= POLLERR;
|
||||||
else if (RINGBUFFER_DATACOUNT(&pipenode->data) < BUFFER_SIZE)
|
// poll will only return POLLOUT if an atomic write can be done without blocking
|
||||||
|
// this is undocumented in POSIX but many unices implement it like this
|
||||||
|
else if (RINGBUFFER_DATACOUNT(&pipenode->data) < BUFFER_SIZE - PIPE_ATOMIC_SIZE)
|
||||||
revents |= POLLOUT;
|
revents |= POLLOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user