diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index c2bb6f135a..46b92231dd 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -1410,6 +1410,14 @@ ErrorOr readlink(StringView pathname) #endif } +ErrorOr poll(Span 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 posix_fallocate(int fd, off_t offset, off_t length) { diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 78e22d3067..986d2d57c8 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -205,6 +206,7 @@ ErrorOr grantpt(int fildes); ErrorOr unlockpt(int fildes); ErrorOr access(StringView pathname, int mode); ErrorOr readlink(StringView pathname); +ErrorOr poll(Span, int timeout); #ifdef AK_OS_SERENITY ErrorOr posix_fallocate(int fd, off_t offset, off_t length);