Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Nov 2014 11:20:05 +0100
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-hackers@freebsd.org, Tiwei Bie <btw@mail.ustc.edu.cn>
Subject:   Re: [PATCH] Finish the task 'sysctl reporting current working directory'
Message-ID:  <20141103102005.GI29497@dft-labs.eu>
In-Reply-To: <20141103090940.GI53947@kib.kiev.ua>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141103102005.GI29497>