From owner-freebsd-commit Wed Nov 15 01:20:03 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA10411 for freebsd-commit-outgoing; Wed, 15 Nov 1995 01:20:03 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA10376 for cvs-all-outgoing; Wed, 15 Nov 1995 01:19:55 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA10361 for cvs-sys-outgoing; Wed, 15 Nov 1995 01:19:51 -0800 Received: from tfs.com (tfs.com [140.145.250.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id BAA10344 ; Wed, 15 Nov 1995 01:19:32 -0800 Received: from critter.tfs.com by tfs.com (smail3.1.28.1) with SMTP id m0tFe0A-0003vlC; Wed, 15 Nov 95 01:19 PST Received: from localhost (localhost [127.0.0.1]) by critter.tfs.com (8.6.11/8.6.9) with SMTP id KAA02527; Wed, 15 Nov 1995 10:19:28 +0100 X-Authentication-Warning: localhost.tfs.com: Host localhost didn't use HELO protocol To: Peter Wemm cc: 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: Your message of "Wed, 15 Nov 1995 12:51:02 +0800." Date: Wed, 15 Nov 1995 10:19:27 +0100 Message-ID: <2525.816427167@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-commit@FreeBSD.ORG Precedence: bulk > Hmm. Poul-Henning has used a useracc(new, newlen, B_READ) before going > into the sysctl handlers. I thought this was sufficient to be reasonably > sure that accidents aren't going to happen? Actually, I still lack one feature, which I deliberatly have held back on. 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. Now, we can agree that the sysctl system call is badly designed. It lacks a get-next, it lacks a "flags" or something similar for controlling a feature like this... 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) 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. This would allow us to use sysctl as a miniature registry for information, for instance: domainname 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 ? -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.