Re: socket owner ( pid )
Re: socket owner ( pid )
- Subject: Re: socket owner ( pid )
- From: Peter Lovell <email@hidden>
- Date: Wed, 16 Oct 2002 09:29:32 -0400
On Wednesday, October 16, 2002, at 07:23 AM, email@hidden wrote:
Hi fokes,
I have a socket filter and I'm trying to get the pid that created or
currently "ownes" the socket. I'd like to be able to get this info
from the kernel without having to go out to user space...
Any suggestions appreciated !!!
-Ollie.
It's ugly and not part of the sanctioned kext interface, but
sometimes you just have to ...
struct proc* p;
p = current_proc();
now look at p->p_cred->p_ruid and p->p_ucred->cr_uid
To get the creator you have to get the proc pointer at socreate
time. The current owner might be different. Whether or not that
matters to you depends on what you're doing, of course.
Cheers.....Peter
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.