mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:57: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:
parent
7bcd386338
commit
562663df7c
12 changed files with 212 additions and 12 deletions
|
@ -90,6 +90,8 @@
|
|||
__ENUMERATE_SYSCALL(seal_shared_buffer) \
|
||||
__ENUMERATE_SYSCALL(sendto) \
|
||||
__ENUMERATE_SYSCALL(recvfrom) \
|
||||
__ENUMERATE_SYSCALL(getsockopt) \
|
||||
__ENUMERATE_SYSCALL(setsockopt) \
|
||||
|
||||
|
||||
namespace Syscall {
|
||||
|
@ -148,6 +150,22 @@ struct SC_recvfrom_params {
|
|||
size_t addr_length; // socklen_t
|
||||
};
|
||||
|
||||
struct SC_getsockopt_params {
|
||||
int sockfd;
|
||||
int level;
|
||||
int option;
|
||||
void* value;
|
||||
void* value_size; // socklen_t*
|
||||
};
|
||||
|
||||
struct SC_setsockopt_params {
|
||||
int sockfd;
|
||||
int level;
|
||||
int option;
|
||||
const void* value;
|
||||
size_t value_size; // socklen_t
|
||||
};
|
||||
|
||||
void initialize();
|
||||
int sync();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue