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

Kernel: Add getsockopt(SO_PEERCRED) for local sockets

This sockopt gives you a struct with the PID, UID and GID of a socket's
peer process.
This commit is contained in:
Andreas Kling 2019-12-06 18:38:36 +01:00
parent 6e6e0b9de8
commit 23e802518d
10 changed files with 72 additions and 12 deletions

View file

@ -337,6 +337,7 @@ struct pollfd {
#define SO_SNDTIMEO 2
#define SO_KEEPALIVE 3
#define SO_ERROR 4
#define SO_PEERCRED 5
#define IPPROTO_IP 0
#define IPPROTO_ICMP 1
@ -345,6 +346,12 @@ struct pollfd {
#define IP_TTL 2
struct ucred {
pid_t pid;
uid_t uid;
gid_t gid;
};
struct sockaddr {
u16 sa_family;
char sa_data[14];