|
XenevaOS
|


Go to the source code of this file.
Classes | |
| struct | AuPollTable |
| struct | _user_poll_fd |
Macros | |
| #define | POLLIN 0x001 |
| #define | POLLPRI 0x002 |
| #define | POLLOUT 0x004 |
| #define | POLLERR 0x008 |
| #define | POLLHUP 0x010 |
| #define | POLLNVAL 0x020 |
| #define | POLLRDNORM 0x040 |
| #define | POLLRDBAND 0x080 |
| #define | POLLWRNORM 0x100 |
| #define | POLLWRBAND 0x200 |
| #define | EPOLLIN POLLIN |
| #define | EPOLLPRI POLLPRI |
| #define | EPOLLOUT POLLOUT |
| #define | EPOLLERR POLLERR |
| #define | EPOLLHUP POLLHUP |
| #define | EPOLLRDNORM POLLRDNORM |
| #define | EPOLLWRNORM POLLWRNORM |
| #define | EPOLLONESHOT (1u << 30) |
| #define | EPOLLET (1u << 31) |
| #define | EPOLL_FLAG_BITS (EPOLLET | EPOLLONESHOT) |
Typedefs | |
| typedef unsigned long int | nfds_t |
| typedef struct AuPollTable | AuPollTable |
| typedef struct _user_poll_fd | _AuUser_PollFD |
Functions | |
| AU_EXTERN AU_EXPORT void | AuPollWait (AuWaitQueue *q, AuPollTable *pt) |
| AuPollWait – helper function to create a wait queue. | |
| int | AuPoll (_AuUser_PollFD fds[], nfds_t num_fd, int timeout) |
| AuPoll – poll system call. | |
| #define EPOLL_FLAG_BITS (EPOLLET | EPOLLONESHOT) |
| #define EPOLLERR POLLERR |
| #define EPOLLET (1u << 31) |
| #define EPOLLHUP POLLHUP |
| #define EPOLLIN POLLIN |
| #define EPOLLONESHOT (1u << 30) |
| #define EPOLLOUT POLLOUT |
| #define EPOLLPRI POLLPRI |
| #define EPOLLRDNORM POLLRDNORM |
| #define EPOLLWRNORM POLLWRNORM |
| #define POLLERR 0x008 |
| #define POLLHUP 0x010 |
| #define POLLIN 0x001 |
BSD 2-Clause License
Copyright (c) 2022 - 2026, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define POLLNVAL 0x020 |
| #define POLLOUT 0x004 |
| #define POLLPRI 0x002 |
| #define POLLRDBAND 0x080 |
| #define POLLRDNORM 0x040 |
| #define POLLWRBAND 0x200 |
| #define POLLWRNORM 0x100 |
| typedef struct _user_poll_fd _AuUser_PollFD |
| typedef struct AuPollTable AuPollTable |
| typedef unsigned long int nfds_t |
|
extern |
AuPoll – poll system call.
| fds | – Pointer to file descriptor array |
| num_fd | – number of file descriptor to monitor |
| timeout | – timeout in millisecond |
copy it from user
check all file descriptors
the poll system call suggest that it revent should have POLLERR | POLLHUP | POLLNVAL present
check for timeout value , 0 means non-blocking and non sleeping, -1 means forever
we should also check for signal, but skipping for now
| AU_EXTERN AU_EXPORT void AuPollWait | ( | AuWaitQueue * | q, |
| AuPollTable * | pt | ||
| ) |
AuPollWait – helper function to create a wait queue.
| q | – Pointer to queue |
| pt | – Pointer to PollTable |