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
commit 23e802518d
Notes: sideshowbarker 2024-07-19 10:57:21 +09:00
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];