Subject: uid,gid, and socket protocols
To: None <email@example.com>
From: Joe Reed <firstname.lastname@example.org>
Date: 09/06/2002 12:03:53
i've got 2 quick questions:
note: i'm doing both of these within the kernel.
1) what is the proper way of getting the uid and gid of a process from the
proc struct? can i just p->p_cred->p_ruid, or would p_svuid be better? or
is there a macro or someting i'm missing?
2) how to i determine what protocol a socket is using? i want to be able to
differentiate between a TCP/UDP/ICMP socket. i was looking at the protosw
struct, but couln't find the values for the pr_protocol member. where are