1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +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

@ -46,6 +46,12 @@ struct sockaddr_in {
char sin_zero[8];
};
struct ucred {
pid_t pid;
uid_t uid;
gid_t gid;
};
#define SOL_SOCKET 1
#define SOMAXCONN 128
@ -53,6 +59,7 @@ struct sockaddr_in {
#define SO_SNDTIMEO 2
#define SO_KEEPALIVE 3
#define SO_ERROR 4
#define SO_PEERCRED 5
int socket(int domain, int type, int protocol);
int bind(int sockfd, const struct sockaddr* addr, socklen_t);