Re: current_task(), struct proc...
Re: current_task(), struct proc...
- Subject: Re: current_task(), struct proc...
- From: Mike Smith <email@hidden>
- Date: Thu, 21 Jul 2005 11:13:30 -0700
On Jul 20, 2005, at 5:24 PM, Herb Petschauer wrote: Under Panther, I can see that in this scenario, current_task() == p->task. I can't see why that wouldn't always be true (in this scenario, I need to do more code reading for a better blanket statement and it's not really important at the moment). Is it safe to just port my ioctl callback routine to use current_task() for both Tiger and Panther?
In a general sense, no. You should use the proc out of the vfs_context_t and fetch its task; this is the mechanism by which proxy work is enabled.
However, if you're in the ioctl handler there is AFAIK no way to be called except on the requester's task, so you're probably safe.
If you have a vfs_context_t to hand, you can sanity-check the context's proc against current_proc() just to be sure; if the two don't match then something odd is going on.
= Mike |
_______________________________________________
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