From owner-freebsd-commit Wed Nov 15 08:42:40 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA20834 for freebsd-commit-outgoing; Wed, 15 Nov 1995 08:42:40 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA20787 for cvs-all-outgoing; Wed, 15 Nov 1995 08:42:29 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA20771 for cvs-sys-outgoing; Wed, 15 Nov 1995 08:42:26 -0800 Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id IAA20684 ; Wed, 15 Nov 1995 08:42:04 -0800 Received: by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM) id AA26165; Wed, 15 Nov 1995 11:41:59 -0500 Date: Wed, 15 Nov 1995 11:41:59 -0500 From: "Garrett A. Wollman" Message-Id: <9511151641.AA26165@halloran-eldar.lcs.mit.edu> To: Poul-Henning Kamp Cc: Peter Wemm , Bruce Evans , CVS-commiters@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Subject: Re: cvs commit: src/sys/kern kern_sysctl.c In-Reply-To: <2525.816427167@critter.tfs.com> References: <2525.816427167@critter.tfs.com> Sender: owner-commit@FreeBSD.ORG Precedence: bulk < said: > The old implementation would lock the (old,oldlen) so that it could > do the copyout without a context-switch. > In all cases but kern.vnode. > I really hate that exception, but on the other hand I'm not sure I really > think we should have that feature anyway. It's going to be quite an effort > to implement atomicity on a SMP system, and I really don't think it is the > right way to solve the problem. I can see that it's a lot easier in the > user-land, but boy is it a mess in the kernel. The purpose of this is to prevent race conditions even in a uniprocessor system. > Now, we can agree that the sysctl system call is badly designed. > It lacks a get-next And so? > I'm not too keen on making yet a new syscall, but it may be the right > thing to do nonetheless. The alternative is to use a oid-prefix: > 0.1. Get/Set with locked user-land buffers > 0.2. GetNext > 0.3. GetInfo, returns name & type info on > 0.4 GetBulk, "new" is a list of OID's, get them all > into "old". (needs some packing rules) Ick. > Another thing I would love to make is a ability to create variables for > user-land purposes: > 0.5. Create a variable, "new" holds info. Do it in the C library; that's why there's code on that side of the interface. > This would allow us to use sysctl as a miniature registry for information, > for instance: > domainname There is no reason to store the domain name anywhere, since all it takes to figure it out is: if ((dom = strchr(hostname, '.')) == 0) flame_stupid_idiot_who_didnt_set_hostname_to_FQDN(); dom++; > which crypt to use as default. > what to do in malloc in case of an allocation error. > anything else you can thing off... > What do you people think ? Ick. -GAWollman -- Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ... wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance. Opinions not those of| It is a bond more powerful than absence. We like people MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant