Additional CAPS IPC work. Add additional system calls to allow a CAPS
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 6 Mar 2004 22:14:16 +0000 (22:14 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 6 Mar 2004 22:14:16 +0000 (22:14 +0000)
commite30f9e2cdf03f1aa09c561bdb923b5b348c7bf8b
treee776a4535298425d4872412919ee7d8f177f4094
parent7c65a2b143d32d7218657b2f6ee87be7c870ea8c
Additional CAPS IPC work.  Add additional system calls to allow a CAPS
server to set a generation number and a CAPS client to query it, which can
be used for any purpose but which is intended to allow a server to tell its
clients to invalidate their caches.

Add missing fork-handling code.  CAPS links are only good on a thread-by-thread
basis.  When a process forks/rforks/clones any active CAPS links will be
created as dummy entries in the forked process, causing CAPS syscalls to
return ENOTCONN.   This allows code based on CAPS to detect when it has been
forked so it can re-connect to the service.

Make a slight change to the API.  caps_sys_put() now returns an immediate
ENOTCONN if it forked.  Note that userland CAPS code must still deal with
the case where a message has been sent and the connection is lost before the
reply is returned.  The kernel automatically replies unreplied messages
with 0-length data in these cases.

Add additional flags to the API, including one that allows a client to
block when connecting to a non-existant service.
sys/kern/init_sysent.c
sys/kern/kern_fork.c
sys/kern/lwkt_caps.c
sys/kern/syscalls.c
sys/kern/syscalls.master
sys/sys/caps.h
sys/sys/syscall-hide.h
sys/sys/syscall.h
sys/sys/syscall.mk
sys/sys/sysproto.h
sys/sys/sysunion.h