Subject: Re: uid,gid, and socket protocols
To: Joe Reed <firstname.lastname@example.org>
From: Andrew Brown <email@example.com>
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
|-----< "CODE WARRIOR" >-----|
firstname.lastname@example.org * "ah! i see you have the internet
email@example.com (Andrew Brown) that goes *ping*!"
firstname.lastname@example.org * "information is power -- share the wealth."