1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibCore: Add a wrapper for poll()

This commit is contained in:
Lucas CHOLLET 2022-12-11 23:40:25 +01:00 committed by Sam Atkins
parent 0049dfd717
commit 5532640b71
2 changed files with 10 additions and 0 deletions

View file

@ -1410,6 +1410,14 @@ ErrorOr<DeprecatedString> readlink(StringView pathname)
#endif
}
ErrorOr<int> poll(Span<struct pollfd> poll_fds, int timeout)
{
auto const rc = ::poll(poll_fds.data(), poll_fds.size(), timeout);
if (rc < 0)
return Error::from_syscall("poll"sv, -errno);
return { rc };
}
#ifdef AK_OS_SERENITY
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length)
{