current_task(), struct proc...
current_task(), struct proc...
- Subject: current_task(), struct proc...
- From: Herb Petschauer <email@hidden>
- Date: Wed, 20 Jul 2005 17:24:40 -0700
This is more of a sanity check (I've done the code check on this under
Panther and a quick look at the Darwin source).
I have a character device (struct cdevsw) that is being installed via
cdevsw_add() (etc.). The ioctl works fine, no problems here.
Under some circumstances, memory mapping is performed (say user to
kernel). Under Panther the task_t id is gotten directly from the
struct proc parameter. Under Tiger, I'm not seeing an API to extract
the task id from the proc struct so I thought that current_task()
would be a safe bet.
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?
Thanks!
Cheers,
H.
_______________________________________________
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