From owner-svn-src-head@freebsd.org Fri May 27 07:39:07 2016 Return-Path: Delivered-To: svn-src-head@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 C9CD8B4C190; Fri, 27 May 2016 07:39:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 8C1CA1B4C; Fri, 27 May 2016 07:39:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F255B1FE024; Fri, 27 May 2016 09:39:04 +0200 (CEST) Subject: Re: svn commit: r300718 - in head/sys: kern sys To: Gleb Smirnoff References: <201605260841.u4Q8ft9r045564@repo.freebsd.org> <20160526213716.GK58287@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Fri, 27 May 2016 09:42:24 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160526213716.GK58287@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 07:39:07 -0000 On 05/26/16 23:37, 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. > Hi, We cannot use the "bool" type in userspace at least, because sizeof(bool) depends on the compiler. So the interface must use an integer type at least, possibly uint8_t like now. Your suggestion makes sense. I'll look at some existing patches extending sysctl and test and make one for bool. --HPS