MOO-cows Mailing List Archive


Re: new builtin request

To: "Seth I. Rich" <>
Message-ID: <>

In message <199509080239.WAA06973@hunny.INS.CWRU.Edu> , you wrote:
>   sys_info()
>     => {hostname, port, database, checkpoint-database}
>   If called with nonwizardly permissions, raises E_PERM.

How about sys_info("key", ...) => {"value", ...}, so when you decide
you want some other random piece of information it can be added easily.
The BSD4.4 sysconf() is a good example (though it has integer keys).
getkerninfo() seems to be deprecated, but had a similar model.  sysctl()
is a read/set interface that replaced getkerninfo().  An unknown key
would raise EINVARG.

> Is this feasable?  Is this dumb?

Other things that might be useful are output from things like getrusage(),
getdtablesize(), uname(), etc.  Though uname() is probably a bad example
of how to implement your sys_info().  :-)

It would probably be wise to consider how the various pieces of information
could be used against the site/machine/server and make it possible for
"dangerous" keys to be disabled at compile time.



Home | Subject Index | Thread Index