Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-11-12 17:40:48 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-11-12 17:40:48 +0300
commit339682e6deba2e703db1c46c7dc0e509fb88531b (patch)
tree9f276c23afd5cc8a89ef77457ac7c6339a3ab619 /winsup/cygwin/sysconf.cc
parentc08f09ab78c1a7ff5ef4392e83c98f4c9fef97aa (diff)
* sysconf.cc (get_nprocs): New function.
(get_nprocs_conf): Ditto. (get_avphys_pages): Ditto. (get_phys_pages): Ditto. * cygwin.din: Export them. * include/sys/sysinfo.h: New header, decalre above new functions. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * posix.sgml: Mention them as GNU extensions.
Diffstat (limited to 'winsup/cygwin/sysconf.cc')
-rw-r--r--winsup/cygwin/sysconf.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc
index cf403fb77..84aced16a 100644
--- a/winsup/cygwin/sysconf.cc
+++ b/winsup/cygwin/sysconf.cc
@@ -1,7 +1,7 @@
/* sysconf.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Red Hat, Inc.
+ 2006, 2007, 2009 Red Hat, Inc.
This file is part of Cygwin.
@@ -11,6 +11,7 @@ details. */
#include "winsup.h"
#include <unistd.h>
+#include <sys/sysinfo.h>
#include "cygerrno.h"
#include "security.h"
#include "path.h"
@@ -292,3 +293,27 @@ confstr (int in, char *buf, size_t len)
set_errno (EINVAL);
return 0;
}
+
+extern "C" int
+get_nprocs_conf (void)
+{
+ return get_nproc_values (_SC_NPROCESSORS_CONF);
+}
+
+extern "C" int
+get_nprocs (void)
+{
+ return get_nproc_values (_SC_NPROCESSORS_ONLN);
+}
+
+extern "C" long
+get_phys_pages (void)
+{
+ return get_nproc_values (_SC_PHYS_PAGES);
+}
+
+extern "C" long
+get_avphys_pages (void)
+{
+ return get_avphys (_SC_AVPHYS_PAGES);
+}