tech-kern archive

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

Re: return value of prop_*_recv_syscall()



On Sat, Sep 24, 2011 at 10:35:41PM +0200, Francois Tigeot wrote:
> Hi,
> 
> I've started working on a new disk quota system for DragonFly this summer,
> and after some time I've discovered Manuel Bouyer had implemented a new
> quota subsystem for NetBSD this year.
> 
> I think the proplib based userland/kernel interface is a good idea and I'd
> like to implement a compatible one.
> 
> While learning how to use proplib, I've found an inconsistency between the
> documentation and the actual kernel implementations:
> 
> the manual page for prop_array_send_syscall, prop_array_recv_syscall,
> prop_dictionary_send_syscall and prop_dictionary_recv_syscall says these
> functions return true if successful
> 
> The kernel implementations are different for prop_array_recv_syscall() and
> prop_dictionary_recv_syscall, they return 0 if there's no error:
> 
> http://nxr.netbsd.org/source/xref/src/common/lib/libprop/prop_kern.c#227
> 
> Since DragonFly's proplib implementation comes from NetBSD, I figured it
> would be best to ask here what to do:
> fix the documentation or fix the implementation ?

The documentation. The implementation can't be exactly the same between
kernel and userland for this kind of functions, because in kernel we have
to return an errno.h value, while in userland the traditionnal way to go
it to return a boolean, and get the error number from a global variable
if we care.

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


Home | Main Index | Thread Index | Old Index