svn commit: r300718 - in head/sys: kern sys

Slawa Olhovchenkov slw at zxy.spb.ru
Fri May 27 12:44:02 UTC 2016


On Thu, May 26, 2016 at 04:54:48PM -0600, Ian Lepore wrote:

> On Thu, 2016-05-26 at 14:37 -0700, Gleb Smirnoff wrote:
> >   Hans,
> > 
> > On Thu, May 26, 2016 at 08:41:55AM +0000, Hans Petter Selasky wrote:
> > H> Author: hselasky
> > H> Date: Thu May 26 08:41:55 2016
> > H> New Revision: 300718
> > H> URL: https://svnweb.freebsd.org/changeset/base/300718
> > H> 
> > H> Log:
> > H>   Add support for boolean sysctl's.
> > H>   
> > H>   Because the size of bool can be implementation defined, make a
> > bool
> > H>   sysctl handler which handle bools. Userspace sees the bools like
> > H>   unsigned 8-bit integers. Values are filtered to either 1 or 0
> > upon
> > H>   read and write, similar to what a compiler would do.
> > H>   
> > H>   Requested by:	kmacy @
> > H>   Sponsored by:	Mellanox Technologies
> > 
> > Would be nice if sysctl(8) would explicitly display them as "true" or
> > "false"
> > instead of 0 and 1. Now the userland can't differ them from uint8_t
> > oids.
> 
> If it displayed them that way, then users would want to set them using
> the true/false strings too.  If you start down that path you eventually

MUST, not want.
This is required by /etc/rc.d/sysctl (displayed value must be match seted)

> end up adding support for 0/1/true/false/yes/no/on/off, and if you
> don't do that in exactly once place you end up with some oids accepting
> all the values and others accepting only some of them, and the user
> experience is confusing at best.
> 
> -- Ian
> 
> _______________________________________________
> svn-src-all at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"


More information about the svn-src-all mailing list