From owner-svn-src-all@freebsd.org Mon Mar 12 17:51:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61DF3F308F0; Mon, 12 Mar 2018 17:51:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087A368A23; Mon, 12 Mar 2018 17:51:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 723D910A87D; Mon, 12 Mar 2018 13:51:32 -0400 (EDT) From: John Baldwin To: Eugene Grosbein Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330711 - head/sbin/sysctl Date: Mon, 12 Mar 2018 09:27:07 -0700 Message-ID: <2456392.O6IgoD01Hy@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <5AA3552D.5080203@grosbein.net> References: <201803092337.w29NbJSX093826@repo.freebsd.org> <5AA3552D.5080203@grosbein.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 12 Mar 2018 13:51:32 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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: Mon, 12 Mar 2018 17:51:34 -0000 On Saturday, March 10, 2018 10:46:53 AM Eugene Grosbein wrote: > 10.03.2018 6:37, John Baldwin wrote: > > > Author: jhb > > Date: Fri Mar 9 23:37:19 2018 > > New Revision: 330711 > > URL: https://svnweb.freebsd.org/changeset/base/330711 > > > > Log: > > Permit sysctl(8) to set an array of numeric values for a single node. > > > > Most sysctl nodes only return a single value, but some nodes return an > > array of values (e.g. kern.cp_time). sysctl(8) understand how to display > > the values of a node that returns multiple values (it prints out each > > numeric value separated by spaces). However, until now sysctl(8) has > > only been able to set sysctl nodes to a single value. This change > > allows sysctl to accept a new value for a numeric sysctl node that contains > > multiple values separated by either spaces or commas. sysctl(8) parses > > this list into an array of values and passes the array as the "new" value > > to sysctl(2). > > Note well: we already have some examples of complex sysctl comma-separated "list" values such as: > > security.mac.portacl.rules=uid:53:tcp:53,uid:53:udp:53 Yes, but those are stored as strings (CTLTYPE_STRING) and require string parsing in the kernel. This permits nodes that just need a flat array of integers to be set without requiring string parsing in the kernel. -- John Baldwin