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