[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A question about the notification in Mach
From: |
Da Zheng |
Subject: |
A question about the notification in Mach |
Date: |
Mon, 01 Jun 2009 08:12:28 +0800 |
User-agent: |
Thunderbird 2.0.0.21 (Macintosh/20090302) |
Hi,
All the notification RPCs (in notify.defs) are simple routines, i.e.,
the client (the kernel) doesn't expect the replies.
Then what is the meaning of the return values of their server code?
Take the function below as an example (it is in proc/notify.c).
If the task port becomes a dead name, the function returns 0; otherwise,
it return EINVAL.
If the kernel doesn't care the return value, why does
do_mach_notify_dead_name handler return different values?
Thank you,
Zheng Da
kern_return_t
do_mach_notify_dead_name (mach_port_t notify,
mach_port_t deadport)
{
struct proc *p;
/* Drop gratuitous extra reference that the notification creates. */
mach_port_deallocate (mach_task_self (), deadport);
if (notify == generic_port)
{
check_dead_execdata_notify (deadport);
return 0;
}
p = ports_lookup_port (proc_bucket, notify, proc_class);
if (!p)
return EOPNOTSUPP;
if (p->p_task == deadport)
{
process_has_exited (p);
ports_port_deref (p);
return 0;
}
else
{
ports_port_deref (p);
return EINVAL;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- A question about the notification in Mach,
Da Zheng <=