Re: Getting the current PID inside kext?
Re: Getting the current PID inside kext?
- Subject: Re: Getting the current PID inside kext?
- From: Andrew Gallatin <email@hidden>
- Date: Tue, 31 Oct 2006 06:05:23 -0500 (EST)
Rick Mann writes:
> getpid() doesn't seem to be available to a kext (I try to include
> <unistd.h> but it fails).
>
> Can I use <sys/proc.h> and extern_proc with current_proc() to get at
> the pid?
Close. Use proc_selfpid() from sys/proc.h, there is no need to look
at the proc struct. The proc_* KPI accessors access the proc
structure for you, so that the kernel developers are free to change
its layout without breaking kernel extensions.
Drew
_______________________________________________
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