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

Add support for socket send/receive timeouts.

Only the receive timeout is hooked up yet. You can change the timeout by
calling setsockopt(..., SOL_SOCKET, SO_RCVTIMEO, ...).

Use this mechanism to make /bin/ping report timeouts.
This commit is contained in:
Andreas Kling 2019-03-13 13:13:23 +01:00
parent 7bcd386338
commit 562663df7c
12 changed files with 212 additions and 12 deletions

View file

@ -46,6 +46,8 @@ struct DisplayInfo {
unsigned pitch;
};
void kgettimeofday(timeval&);
class Process : public InlineLinkedListNode<Process>, public Weakable<Process> {
friend class InlineLinkedListNode<Process>;
public:
@ -233,6 +235,8 @@ public:
int sys$connect(int sockfd, const sockaddr*, socklen_t);
ssize_t sys$sendto(const Syscall::SC_sendto_params*);
ssize_t sys$recvfrom(const Syscall::SC_recvfrom_params*);
int sys$getsockopt(const Syscall::SC_getsockopt_params*);
int sys$setsockopt(const Syscall::SC_setsockopt_params*);
int sys$restore_signal_mask(dword mask);
int sys$create_shared_buffer(pid_t peer_pid, int, void** buffer);