tech-kern archive

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

Re: prop_*_internalize and copyin/out for syscall ?



On Tue, Jan 18, 2011 at 10:02:14PM +0100, Adam Hamsik wrote:
> 
> On Jan,Monday 17 2011, at 6:00 PM, Manuel Bouyer wrote:
> 
> > On Mon, Jan 17, 2011 at 04:33:25PM +0100, Manuel Bouyer wrote:
> >> [sorry for the cross-post, but I can't decide which list is more 
> >> appropriate
> >> than the other :) ]
> >> 
> >> Hello,
> >> so I'm evaluating how to use proplib for the new quotactl(2) I'm working 
> >> on.
> >> I see there is already provision of function to pass property list between
> >> kernel and userland using ioctl, but there is no equivalent for syscalls.
> >> Should there be ?
> >> For kernel land, prop_{array,dictionary}_copy{in,out} would do it
> >> (prop_{array,dictionary}_copyout is documented but not implemented,
> >> this is easy).
> >> For userland, we probably need a prop_{array,dictionary}_recv_syscall(),
> >> wich takes as parameter the pref we got from kernel, and internalize it.
> >> Parameters would be the pref, and a pointer to the prop_array_t or
> >> prop_dictionary_t that will get the result. What this would do in
> >> addition to call prop_{array,dictionary}_internalize_from_pref() is
> >> to unmap the buffer the kernel mmaped for us. I don't think this details 
> >> of the
> >> kernel/userland communication should be exposed outside of the
> >> proplib code.
> >> 
> >> For symetry, we probably want a prop_{array,dictionary}_send_syscall()
> >> which is just an alias to prop_{array,dictionary}_externalize_to_pref()
> >> 
> >> Comments ?
> > 
> > here is a diff implementing the above
> > 
> > -- 
> > Manuel Bouyer <bouyer%antioche.eu.org@localhost>
> >     NetBSD: 26 ans d'experience feront toujours la difference
> > --
> > <proplib.diff>
> 
> I think this patch looks fine. You should commit it.

thanks, commited. I also tested it with my new quotactl(2) and it does
the job.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index