Is it legal for a driver to use current_proc() in tiger?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com According to the comments in Tiger's proc.h, proc_self() seems to be the KPIish way to get a pointer to the current process: /* returns a handle to current process which is referenced. The reference needs to be dropped with proc_rele */ extern proc_t proc_self(void); But I don't want a referenced handle. I promise to always use it in that process context and not cache it anyplace. Since I'm using it in my ioctl routine, the process is not going to disappear. Is it legal to just continue to use current_proc()? If not, then the implicit reference means I'm doing 3 function calls to check if a process is 64-bit: proc_t p = proc_self(); is_64bit = proc_is64bit(p); proc_rele(p); This is especially annoying since the proc_rele() is currently a noop, and proc_self() is just a wrapper for current_proc() ;) Thanks, 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