From owner-svn-src-all@freebsd.org Thu May 26 22:54:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C816B47893 for ; Thu, 26 May 2016 22:54:57 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58B81C95 for ; Thu, 26 May 2016 22:54:56 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ece969a8-2394-11e6-9de8-1b78d5a2543b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 26 May 2016 22:55:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4QMsmew005953; Thu, 26 May 2016 16:54:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1464303288.1204.65.camel@freebsd.org> Subject: Re: svn commit: r300718 - in head/sys: kern sys From: Ian Lepore To: Gleb Smirnoff , Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 26 May 2016 16:54:48 -0600 In-Reply-To: <20160526213716.GK58287@FreeBSD.org> References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 22:54:57 -0000 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 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