Subject: Re: uid,gid, and socket protocols
To: Joe Reed <jnr@po.cwru.edu>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 09/06/2002 12:07:32
>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?

p->p_ucred->cr_uid and p->p_ucred->cr_gid, i would imagine.  unless
you specifically want the real uid or saved uid.

>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 
>they located?

so->so_proto->pr_protocol?

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."