1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

Kernel+LibC+UserspaceEmulator: Add SO_TIMESTAMP, and cmsg definitions

When SO_TIMESTAMP is set as an option on a SOCK_DGRAM socket, then
recvmsg() will return a SCM_TIMESTAMP control message that
contains a struct timeval with the system time that was current
when the socket was received.
This commit is contained in:
Nico Weber 2020-09-16 12:32:45 -04:00 committed by Andreas Kling
parent ae5ba4074d
commit 47b3e98af8
6 changed files with 94 additions and 2 deletions

View file

@ -458,6 +458,7 @@ struct pollfd {
#define SHUT_RDWR 3
#define MSG_TRUNC 0x1
#define MSG_CTRUNC 0x2
#define MSG_DONTWAIT 0x40
#define SOL_SOCKET 1
@ -471,6 +472,11 @@ enum {
SO_REUSEADDR,
SO_BINDTODEVICE,
SO_KEEPALIVE,
SO_TIMESTAMP,
};
enum {
SCM_TIMESTAMP,
};
#define IPPROTO_IP 0
@ -556,6 +562,12 @@ struct iovec {
size_t iov_len;
};
struct cmsghdr {
socklen_t cmsg_len;
int cmsg_level;
int cmsg_type;
};
struct msghdr {
void* msg_name;
socklen_t msg_namelen;