[PATCH] add get_nprocs, get_nprocs_conf

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Nov 12 14:42:00 GMT 2009


On Nov 12 04:10, Yaakov S wrote:
> On 12/11/2009 03:44, Corinna Vinschen wrote:
> >In this case I'm rather surprised that these very GNU/Linux specific
> >things are *not* in a linux/sysinfo.h file.  But it doesn't hurt to keep
> >that in line with Linux, right?
> 
> In that case, here is a patch which declares directly in sys/sysinfo.h.
> 
> 
> Yaakov

> 2009-11-12  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
> 
> 	* sysconf.cc (get_nprocs, get_nprocs_conf): New functions.
> 	* cygwin.din: Export them.
> 	* include/sys/sysinfo.h: New header.
> 	(get_nprocs, get_nprocs_conf): Declare.
> 	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
> 	* posix.sgml: Mention them as GNU extensions.

Thanks, I applied the change with a few changes.

First of all, I took the opportunity to add get_phys_pages and
get_avphys_pages as well so we only have to bump the API minor
number once.

Second, I added the C++ guards to sys/sysinfo.h, as Vaclav pointeed out.

Third, a tiny formatting change:

> +extern "C" int
> +get_nprocs_conf (void)
> +{
> +  return get_nproc_values(_SC_NPROCESSORS_CONF);
                           ^^^
                           Please add a space in front of an opening
                           parenthesis.

Finally, I added the new API to the "What's new" section in the User's
Guide as well.


Thanks again,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-patches mailing list