mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +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
|
#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
|
#ifdef AK_OS_SERENITY
|
||||||
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length)
|
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
|
@ -205,6 +206,7 @@ ErrorOr<void> grantpt(int fildes);
|
||||||
ErrorOr<void> unlockpt(int fildes);
|
ErrorOr<void> unlockpt(int fildes);
|
||||||
ErrorOr<void> access(StringView pathname, int mode);
|
ErrorOr<void> access(StringView pathname, int mode);
|
||||||
ErrorOr<DeprecatedString> readlink(StringView pathname);
|
ErrorOr<DeprecatedString> readlink(StringView pathname);
|
||||||
|
ErrorOr<int> poll(Span<struct pollfd>, int timeout);
|
||||||
|
|
||||||
#ifdef AK_OS_SERENITY
|
#ifdef AK_OS_SERENITY
|
||||||
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length);
|
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue