1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:37:45 +00:00

Stub out poll() syscall and LibC wrapper.

This commit is contained in:
Andreas Kling 2019-01-23 07:27:41 +01:00
parent 8bb18fdc56
commit 2bedabbd6c
10 changed files with 63 additions and 10 deletions

1
Kernel/.gitignore vendored
View file

@ -4,3 +4,4 @@ Boot/boot.bin
kernel
kernel.map
_fs_contents
sync-local.sh

View file

@ -2002,6 +2002,13 @@ int Process::sys$select(const Syscall::SC_select_params* params)
return markedfds;
}
int Process::sys$poll(pollfd* fds, int nfds, int timeout)
{
if (!validate_read_typed(fds))
return -EFAULT;
return 0;
}
Inode* Process::cwd_inode()
{
// FIXME: This is retarded factoring.

View file

@ -157,6 +157,7 @@ public:
int sys$munmap(void*, size_t size);
int sys$set_mmap_name(void*, size_t, const char*);
int sys$select(const Syscall::SC_select_params*);
int sys$poll(pollfd*, int nfds, int timeout);
ssize_t sys$get_dir_entries(int fd, void*, size_t);
int sys$getcwd(char*, size_t);
int sys$chdir(const char*);

View file

@ -100,6 +100,8 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
return (dword)current->sys$mmap((const SC_mmap_params*)arg1);
case Syscall::SC_select:
return current->sys$select((const SC_select_params*)arg1);
case Syscall::SC_poll:
return current->sys$poll((pollfd*)arg1, (int)arg2, (int)arg3);
case Syscall::SC_munmap:
return current->sys$munmap((void*)arg1, (size_t)arg2);
case Syscall::SC_gethostname:

View file

@ -75,6 +75,7 @@
__ENUMERATE_SYSCALL(gui_get_window_parameters) \
__ENUMERATE_SYSCALL(gui_set_window_parameters) \
__ENUMERATE_SYSCALL(unlink) \
__ENUMERATE_SYSCALL(poll) \
struct fd_set;

View file

@ -291,3 +291,16 @@ struct stat {
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last status change */
};
#define POLLIN (1u << 0)
#define POLLPRI (1u << 2)
#define POLLOUT (1u << 3)
#define POLLERR (1u << 4)
#define POLLHUP (1u << 5)
#define POLLNVAL (1u << 6)
struct pollfd {
int fd;
short events;
short revents;
};

View file

@ -1,10 +0,0 @@
cp ../../figlet-2.2.5/figlet mnt/bin/
mkdir -p mnt/usr/local/share/figlet
FIGLET_FONTDIR=/
cp ../../figlet-2.2.5/fonts/standard.flf mnt/$FIGLET_FONTDIR
cp ../../figlet-2.2.5/fonts/big.flf mnt/$FIGLET_FONTDIR
cp ../../figlet-2.2.5/fonts/slant.flf mnt/$FIGLET_FONTDIR
cp ../../figlet-2.2.5/fonts/lean.flf mnt/$FIGLET_FONTDIR
cp ../../bash-2.05b/bash mnt/bin/bash