mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
kernel: poll system and poll syscall
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <kernel/alloc.h>
|
||||
#include <errno.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <kernel/poll.h>
|
||||
|
||||
#define PATHNAME_MAX 512
|
||||
#define MAXLINKDEPTH 64
|
||||
@@ -27,6 +28,18 @@ static cred_t *getcred() {
|
||||
return &_cpu()->thread->proc->cred;
|
||||
}
|
||||
|
||||
int vfs_pollstub(vnode_t *node, struct polldata *, int events) {
|
||||
int revents = 0;
|
||||
|
||||
if (events & POLLIN)
|
||||
revents |= POLLIN;
|
||||
|
||||
if (events & POLLOUT)
|
||||
revents |= POLLOUT;
|
||||
|
||||
return revents;
|
||||
}
|
||||
|
||||
void vfs_init() {
|
||||
__assert(hashtable_init(&fstable, 20) == 0);
|
||||
vfsroot = alloc(sizeof(vnode_t));
|
||||
|
||||
Reference in New Issue
Block a user