From owner-freebsd-hackers Tue Jun 30 16:05:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA25525 for freebsd-hackers-outgoing; Tue, 30 Jun 1998 16:05:22 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from digi.digiware.nl (gtw.digiware.nl [194.151.72.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA25440 for ; Tue, 30 Jun 1998 16:05:04 -0700 (PDT) (envelope-from wjw@digi.digiware.nl) Received: by digi.digiware.nl (8.8.7/1.63) id XAA07485; Tue, 30 Jun 1998 23:03:37 GMT From: wjw@digi.digiware.nl (Willem Jan Withagen) Message-Id: <199806302303.XAA07485@digi.digiware.nl> Subject: Variant Link implementation, continued In-Reply-To: <199806080712.AAA09745@antipodes.cdrom.com> from Mike Smith at "Jun 8, 98 00:12:57 am" To: mike@smith.net.au (Mike Smith) Date: Wed, 1 Jul 1998 01:03:37 +0200 (CEST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31H (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG => > >> If we really wanted to get variant symlinks, I would suggest copying => > >> the already-fairly-well-known syntax of AFS, `@name_of_parameter'. As => > >> the metasyntactic variable suggests, these should be (a fairly small => > >> number of) parameters which hold system-wide. (Indeed, given the => > >> existence of the sysctlbyname interface in the kernel, one could => > >> simply kick them off in that direction.) => > > => > >Ok. I did actually look at how this could be implemented last time it => > >came up, and I think it would be *reasonably* straightforward. I have actual working code for this. At the moment every variantlink gets replaced by '2.2.6', since that is my current OS version. And /usr/local is thus pointing to /usr/local.${OSVERSION} lrwxrwxrwx 1 root wheel 20 Jul 1 00:50 local@ -> ./.local.${OSVERSION} lrwxrwxrwx 1 root wheel 12 Mar 1 23:08 .local.2.2.6@ -> /home2/local lrwxrwxrwx 1 root wheel 12 Mar 1 23:08 .local.@ -> /home2/local Which is running for quite a while (1-2 weeks). The last link is to be used in case I run a kernel with actual variant translation but OSVERSION is not defined. So I'm up for the next challenge: => Start small; once this is working for you, the next step is the => 'defaults' space, which should be sysctl-accessible. Then you can => start worrying about how to become more process-specific. * sysctl-accessable variant parameters. Currently all I know about this comes from 'man 3 sysctl' and browsing through the kernel-source. But I've never finished my reading on MIB's so any help an/or suggestion is welcom. My 2 major questions: - How can I efficiently obtain the value of a sysctl value? And should they look like 'variant.name', or would/should a variant link be able to look like: kern.osrelease: 2.2.6-STABLE - It seems that names are allocated from within the kernel upon startup, nothing dynamic. Is there any work in progress to make this more flexible? I could start by first creating a standard set of names. * An alternative would be: How do I obtain the environment of the process using the link? (assuming it has nog messed with its *env-pointer) Thanx, --WjW To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message