• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get socket creator (ie: PID & UID)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get socket creator (ie: PID & UID)


  • Subject: Re: Get socket creator (ie: PID & UID)
  • From: Peter Lovell <email@hidden>
  • Date: Sun, 20 Feb 2005 10:24:41 -0500

You'll find the definition of struct proc in <sys/proc.h>

You code for pid will be something like
   the_pid = current_proc()->p_pid;


On Feb 20, 2005, at 7:38 AM, Vincent Pottier wrote:

Thanks a lot Peter, it work just fine, but I can't find the struct architecture, I've search through the web and in the Header file, but can't find the struct references, I've try with p_pid for the PID (and other few things) , but I always get an error.
Can someone tell me where to find this struct references (or find documentation about current_proc)?
Thanks in advance,
Vincent


On 19 févr. 05, at 18:38, Peter Lovell wrote:


On Feb 19, 2005, at 12:15 PM, Vincent Pottier wrote:

Hi folks,

I've the tcplogger sample code and I would like to get the socket creator PID and UID. After a few search, It looks that I can get it via current_proc() called on socreate time. But this feature is disable in the sample I have and I get an error when using it. (warning: implicit declaration of function 'current_proc'). I've already try to #include some object but can't make it work.

    Does someone can explain me how to use it?

    Thanks in advance,

Vincent

Hi Vincent, the definition is in <sys/vm.h> (in Kernel.framework) ...

struct proc *current_proc(void);


The struct is subject to change of course, but if you're working with tcplogger then you already know that.


Regards.....Peter



_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Get socket creator (ie: PID & UID)
      • From: Vincent Pottier <email@hidden>
References: 
 >Get socket creator (ie: PID & UID) (From: Vincent Pottier <email@hidden>)
 >Re: Get socket creator (ie: PID & UID) (From: Peter Lovell <email@hidden>)
 >Re: Get socket creator (ie: PID & UID) (From: Vincent Pottier <email@hidden>)

  • Prev by Date: Re: Get socket creator (ie: PID & UID)
  • Next by Date: Re: Get socket creator (ie: PID & UID)
  • Previous by thread: Re: Get socket creator (ie: PID & UID)
  • Next by thread: Re: Get socket creator (ie: PID & UID)
  • Index(es):
    • Date
    • Thread