XenevaOS
Loading...
Searching...
No Matches
Macros | Functions
poll.c File Reference
#include <Sync/poll.h>
#include <bordoisila_ptr.h>
#include <Log/klog.h>
#include <Log/_print.h>
#include <Hal/AA64/sched.h>
#include <timer.h>
#include <Fs/vfs.h>
#include <process.h>
#include <Drivers/uart.h>
#include <_null.h>
#include <Mm/kmalloc.h>
#include <fixup.h>
Include dependency graph for poll.c:

Macros

#define POLL_MAX_FD_MONITOR   1024
 

Functions

AuVFSNode * AuPollGetFile (AA64Thread *thr, int fd)
 
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

◆ POLL_MAX_FD_MONITOR

#define POLL_MAX_FD_MONITOR   1024

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.

Function Documentation

◆ AuPoll()

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

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

◆ AuPollGetFile()

AuVFSNode * AuPollGetFile ( AA64Thread *  thr,
int  fd 
)

◆ AuPollWait()

void AuPollWait ( AuWaitQueue *  q,
AuPollTable *  pt 
)

AuPollWait – helper function to create a wait queue.

Parameters
q– Pointer to queue
pt– Pointer to PollTable