DragonFly BSD
DragonFly kernel List (threaded) for 2003-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

splitting sysctl


From: "David P. Reese, Jr." <daver@xxxxxxxxxxxx>
Date: 30 Oct 2003 08:55:06 GMT

There are a number of COMPAT_43 syscalls that use userland_sysctl().
I'm trying to figure out if it is possible to do a clean split for
sysctl() without requiring too many copies.

Currently, the sysctl code allows the sysctl_req structure to be
populated with oldfunc() and newfunc() members that move the actual
data back and fourth.  We can choose to move data to and from userland
by using the userland versions of these functions or we can move data
within the kernel by using the kernel space versions.

I'd like to move all of the copyin()/copyout() work out of the sysctl
internals.  To do so without using an excessive amount of copies
kern_sysctl() could return a pointer to the actual data in the MIB
tree.  Thus, a call to __sysctl() that returns a large string or
a big chunk of opaque data to userland only has to a single copy.

The only problem with this approach is that the client function has
to be careful not to modify which is pointed to.  Is this drawback
tollerable?

-- 
   David P. Reese, Jr.                                     daver@xxxxxxxxxxxx
                                               http://www.gomerbud.com/daver/



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]