in src/io/_Private/FileDescriptorHandle.php [29:50]
final protected async function selectAsync(
int $flags,
int $timeout_ns,
): Awaitable<void> {
if (!$this->isAwaitable) {
return;
}
try {
$result = await _OS\poll_async($this->impl, $flags, $timeout_ns);
if ($result === \STREAM_AWAIT_CLOSED) {
_OS\throw_errno(OS\Errno::EBADFD, "Can't await a closed FD");
}
} catch (_OS\ErrnoException $e) {
if ($e->getCode() === OS\Errno::ENOTSUP) {
// e.g. real files on Linux when using epoll
$this->isAwaitable = false;
return;
}
throw $e;
}
}