Is it legal for a driver to use current_proc() in tiger?
Is it legal for a driver to use current_proc() in tiger?
- Subject: Is it legal for a driver to use current_proc() in tiger?
- From: Andrew Gallatin <email@hidden>
- Date: Wed, 29 Jun 2005 17:01:44 -0400 (EDT)
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden