On Wednesday, October 16, 2002, at 07:23 AM, ollie@mac.com 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 | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Peter Lovell