mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +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;
|
||||
if (pipenode->readers == 0)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user