blob: 0e37153a7d1fb4ca9512fcde2f6d7f8500d51676 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <fs/vfs.h>
#include <poll.h>
#include <scalls/recvfrom.h>
size_t syscall_recvfrom(int socket, void *buffer, size_t length, int flags,
struct sockaddr *address, socklen_t *address_len) {
if (flags & MSG_WAITALL) {
struct pollfd fds[1];
fds[0].fd = socket;
fds[0].events = POLLIN;
poll(fds, 1, 0);
}
kprintf("got event\n");
return vfs_pread(socket, buffer, length, 0);
}
|