Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Nov 1995 11:41:59 -0500
From:      "Garrett A. Wollman" <wollman@lcs.mit.edu>
To:        Poul-Henning Kamp <phk@critter.tfs.com>
Cc:        Peter Wemm <peter@jhome.dialix.com>, Bruce Evans <bde@zeta.org.au>, CVS-commiters@freefall.freebsd.org, cvs-sys@freefall.freebsd.org
Subject:   Re: cvs commit: src/sys/kern kern_sysctl.c 
Message-ID:  <9511151641.AA26165@halloran-eldar.lcs.mit.edu>
In-Reply-To: <2525.816427167@critter.tfs.com>
References:  <Pine.BSF.3.91.951115124212.309I-100000@jhome.DIALix.COM> <2525.816427167@critter.tfs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Wed, 15 Nov 1995 10:19:27 +0100, Poul-Henning Kamp <phk@critter.tfs.com> 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.<oid>	Get/Set with locked user-land buffers
> 	0.2.<oid>	GetNext
> 	0.3.<oid>	GetInfo, returns name & type info on <oid>
> 	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.<oid>	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



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