Re: Getting the current PID inside kext?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Andrew Gallatin