From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 3 10:20:11 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE591B62; Mon, 3 Nov 2014 10:20:11 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4B89BC; Mon, 3 Nov 2014 10:20:10 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id b13so10080280wgh.11 for ; Mon, 03 Nov 2014 02:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=z0cP0gsnY29DeIA36bzjQiZzSm0s3Uf5vKOhmmILVtU=; b=WEz0gBjfD//3y5mgfI4JvHSkr7vKZMV6AuzdJRIayFd+lAQJU/WUC6qQ5Iv9IlyO8w eIdbCV9YAyN+ytEPeJm4Z4rCz2s7Av2flfSs2LRSDg+K8u4OaUDN6WrIGI4KnSpb9/oo RRQvz5xWjFb7+y4YAjfR4Q4FNR46lQaoRJWESVxgee9MPwARevJFepAt/9v/IYYRG5iW FfSsdv+/Y+DhvlJc9lNACeBoDMzm1mtUMQym+yEga4X3bkTzKxD3knf+Z+0zjumCUqBY yPhS0hjqXwRPfTDwYuiXFGIgwGZxWhB4e2lvkN2QedPKVC3P9PEM357YRoDOE1OosAWQ WYZQ== X-Received: by 10.180.86.38 with SMTP id m6mr14962768wiz.65.1415010008401; Mon, 03 Nov 2014 02:20:08 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id ws2sm21645135wjc.32.2014.11.03.02.20.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 02:20:07 -0800 (PST) Date: Mon, 3 Nov 2014 11:20:05 +0100 From: Mateusz Guzik To: Konstantin Belousov Subject: Re: [PATCH] Finish the task 'sysctl reporting current working directory' Message-ID: <20141103102005.GI29497@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Konstantin Belousov , Julian Elischer , Tiwei Bie , freebsd-hackers@freebsd.org References: <1414987325-23280-1-git-send-email-btw@mail.ustc.edu.cn> <20141103051908.GC29497@dft-labs.eu> <20141103064052.GA1739@freebsd> <5457394E.4050905@freebsd.org> <20141103084129.GF29497@dft-labs.eu> <20141103090940.GI53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20141103090940.GI53947@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Tiwei Bie X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:20:11 -0000 On Mon, Nov 03, 2014 at 11:09:40AM +0200, Konstantin Belousov wrote: > On Mon, Nov 03, 2014 at 09:41:29AM +0100, Mateusz Guzik wrote: > > On Mon, Nov 03, 2014 at 04:14:06PM +0800, Julian Elischer wrote: > > > why are you using a fixed sysctl MIB number? > > > I thought we were moving towards dynamic sysctls when we add new ones. > > > > > > > We are? KERN_PROC_* seems to be a complete list with SIGTRAMP added last > > year. > > > > I guess we can do it with OID_AUTO, if there will be any need we can > > switch it back to a static var. > > I am very curious how would you make kern.proc.cwd auto, while > still using kern.proc leaf. And more important question is, why ? Unclear what you mean. I just tested with marking it OID_AUTO and it works. Userspace code does sysctlbyname to look it up and sysctl + mib[3] = pid to call, no problems that I can see. I'm not a fan of this because of the need for lookup for what is a compiled in and always available sysctl. I only said we can do OID_AUTO because of Julian's complaint. Was about to do some search for apparent agreement to not add more static sysctls, but your reply suggests there was no such thing. That said, I prefer static version. -- Mateusz Guzik