XenevaOS
Loading...
Searching...
No Matches
poll.h
Go to the documentation of this file.
1
30#ifndef __POLL_H__
31#define __POLL_H__
32
33#include <stdint.h>
34#include <Sync/waitq.h>
35#include <Hal/AA64/sched.h>
36
37#define POLLIN 0x001
38#define POLLPRI 0x002
39#define POLLOUT 0x004
40#define POLLERR 0x008
41#define POLLHUP 0x010
42#define POLLNVAL 0x020
43#define POLLRDNORM 0x040
44#define POLLRDBAND 0x080
45#define POLLWRNORM 0x100
46#define POLLWRBAND 0x200
47
48#define EPOLLIN POLLIN
49#define EPOLLPRI POLLPRI
50#define EPOLLOUT POLLOUT
51#define EPOLLERR POLLERR
52#define EPOLLHUP POLLHUP
53#define EPOLLRDNORM POLLRDNORM
54#define EPOLLWRNORM POLLWRNORM
55#define EPOLLONESHOT (1u << 30)
56#define EPOLLET (1u << 31)
57#define EPOLL_FLAG_BITS (EPOLLET | EPOLLONESHOT)
58
59typedef unsigned long int nfds_t;
60
61typedef struct AuPollTable {
62 AA64Thread* thread;
63 /* should have wait function here*/
64 void* priv;
66 int error;
68
69typedef struct _user_poll_fd {
70 int fd; /* file descriptor to poll*/
71 short events; /* requested events */
72 short revents; /* returned events */
86extern int AuPoll(_AuUser_PollFD fds[], nfds_t num_fd, int timeout);
87
88#endif
int AuPoll(_AuUser_PollFD fds[], nfds_t num_fd, int timeout)
AuPoll – poll system call.
Definition poll.c:91
struct _user_poll_fd _AuUser_PollFD
unsigned long int nfds_t
Definition poll.h:59
AU_EXTERN AU_EXPORT void AuPollWait(AuWaitQueue *q, AuPollTable *pt)
AuPollWait – helper function to create a wait queue.
Definition poll.c:68
#define AU_EXTERN
Definition aurora.h:54
#define AU_EXPORT
Definition aurora.h:40
Definition poll.h:61
AuWaitQEntry * chain
Definition poll.h:65
int error
Definition poll.h:66
void * priv
Definition poll.h:64
AA64Thread * thread
Definition poll.h:62
Definition waitq.h:48
Definition waitq.h:39
Definition poll.h:69
int fd
Definition poll.h:70
short events
Definition poll.h:71
short revents
Definition poll.h:72
Definition crypto.c:514