>Is there an example in the current source where a kernel thread calls up into
>a user-space program
? I thought doors allowed this, but I'm not 100% sure. Examples are always
nice. :)
>
>I ask because it might be possible to make the current IPsec/Key-Management
>interface (the PF_KEY
socket) be quicker, or better exploit a multithreaded key management
application.
I'm sure there is; look dor door_ki_upcall; here's one I did
earlier (for my own project):
door_arg_t da;
int res;
int dres;
da.data_ptr = (char *)req;
da.data_size = sizeof (*req);
da.desc_ptr = NULL;
da.desc_num = 0;
da.rbuf = (char *)&res;
da.rsize = sizeof (res);
while ((dres = door_ki_upcall(p->my_door, &da)) != 0) {
switch (dres) {
case EINTR:
case EAGAIN:
delay(1);
continue;
case EINVAL:
case EBADF:
(void) my_unreg_dh(p->my_door);
default:
return (-1);
}
}
/* Bogus big return value */
if (da.rbuf != (char *)&res) {
kmem_free(da.rbuf, da.rsize);
return (-1);
}
return (res);
You need to hold a reference to the door using dh = door_ki_lookup(fd)
and when it goes bad or you want to unregister you release it
with door_ki_rele(dh)
Casper
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code