XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
poll.h File Reference
#include <stdint.h>
#include <Sync/waitq.h>
#include <Hal/AA64/sched.h>
Include dependency graph for poll.h:
This graph shows which files directly or indirectly include this file:

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.
 

Macro Definition Documentation

◆ EPOLL_FLAG_BITS

#define EPOLL_FLAG_BITS   (EPOLLET | EPOLLONESHOT)

◆ EPOLLERR

#define EPOLLERR   POLLERR

◆ EPOLLET

#define EPOLLET   (1u << 31)

◆ EPOLLHUP

#define EPOLLHUP   POLLHUP

◆ EPOLLIN

#define EPOLLIN   POLLIN

◆ EPOLLONESHOT

#define EPOLLONESHOT   (1u << 30)

◆ EPOLLOUT

#define EPOLLOUT   POLLOUT

◆ EPOLLPRI

#define EPOLLPRI   POLLPRI

◆ EPOLLRDNORM

#define EPOLLRDNORM   POLLRDNORM

◆ EPOLLWRNORM

#define EPOLLWRNORM   POLLWRNORM

◆ POLLERR

#define POLLERR   0x008

◆ POLLHUP

#define POLLHUP   0x010

◆ POLLIN

#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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

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.

◆ POLLNVAL

#define POLLNVAL   0x020

◆ POLLOUT

#define POLLOUT   0x004

◆ POLLPRI

#define POLLPRI   0x002

◆ POLLRDBAND

#define POLLRDBAND   0x080

◆ POLLRDNORM

#define POLLRDNORM   0x040

◆ POLLWRBAND

#define POLLWRBAND   0x200

◆ POLLWRNORM

#define POLLWRNORM   0x100

Typedef Documentation

◆ _AuUser_PollFD

typedef struct _user_poll_fd _AuUser_PollFD

◆ AuPollTable

typedef struct AuPollTable AuPollTable

◆ nfds_t

typedef unsigned long int nfds_t

Function Documentation

◆ AuPoll()

int AuPoll ( _AuUser_PollFD  fds[],
nfds_t  num_fd,
int  timeout 
)
extern

AuPoll – poll system call.

Parameters
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

◆ AuPollWait()

AU_EXTERN AU_EXPORT void AuPollWait ( AuWaitQueue *  q,
AuPollTable *  pt 
)

AuPollWait – helper function to create a wait queue.

Parameters
q– Pointer to queue
pt– Pointer to PollTable