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:
parent
0049dfd717
commit
5532640b71
2 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue