[squeak-dev] Pool for sysconf constants?

David T. Lewis lewis at mail.msen.com
Tue Oct 13 03:28:17 UTC 2020


On Sun, Oct 11, 2020 at 11:15:09AM -0700, Eliot Miranda wrote:
> Hi All,
> 
>     I want to implement a number of processors query on MacOS & other
> unices to complement the info provided by GetSystemInfo on Windows. The
> natural way to do this on unices is to use sysconf (3), and of course this
> points to the issue for which FFI pools are needed, the constant names for
> sysconf such as _SC_NPROCESSORS_ONLN are defined, but their values are
> implementation dependent.
> 
> But before I go amd implement an FFI pool for this I thought I'd ask
> a) anyone already done this?  Is it published anywhere?
> b) how are we going to organize such pools so that people don't have to
> reinvent the wheel?
> c) should there be a pool to cover sysconf or to cover unistd.h?  (the
> point here is that while the pool might start off small, it could grow and
> grow and maybe unistd.h is too much surface to cover)
> 
> thoughts, suggestions?

Hi Eliot,

At first glance, it looks to me like the hard part of the problem is to
know what sysconf names are available to be queried on any given platform
at runtime.  If you know that, or if you are only interested in a limited
number of well-known parameters (which seems likely), then it might be
simplest to just implement the sysconf(3) call either as an FFI call or
a call through the OSProcess plugin.

But I suspect that I am not answering the right question here. If I am
off base, can you give an example of some of the parameters that you
would want to be able to query?

Thanks,
Dave



More information about the Squeak-dev mailing list