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
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')
-rw-r--r--winsup/cygwin/ChangeLog12
-rw-r--r--winsup/cygwin/cygwin.din4
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/include/sys/sysinfo.h27
-rw-r--r--winsup/cygwin/posix.sgml4
-rw-r--r--winsup/cygwin/sysconf.cc27
6 files changed, 75 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 747672a43..eaa3433f5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+ Corinna Vinschen <corinna@vinschen.de>
+
+ * 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.
+
2009-11-11 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_mailslot): Declare new private method
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index a10d18ca0..74c487946 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -598,8 +598,12 @@ gcvt SIGFE
_gcvt = gcvt SIGFE
gcvtf SIGFE
_gcvtf = gcvtf SIGFE
+get_avphys_pages SIGFE
+get_nprocs SIGFE
+get_nprocs_conf SIGFE
get_osfhandle SIGFE
_get_osfhandle = get_osfhandle SIGFE
+get_phys_pages SIGFE
getaddrinfo = cygwin_getaddrinfo SIGFE
getc SIGFE
_getc = getc SIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index e88bb9d9a..763a26c7c 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -371,12 +371,13 @@ details. */
215: CW_EXIT_PROCESS added.
216: CW_SET_EXTERNAL_TOKEN added.
217: CW_GET_INSTKEY added.
+ 218: Export get_nprocs, get_nprocs_conf, get_phys_pages, get_avphys_pages.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 217
+#define CYGWIN_VERSION_API_MINOR 218
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/include/sys/sysinfo.h b/winsup/cygwin/include/sys/sysinfo.h
new file mode 100644
index 000000000..1e24c860a
--- /dev/null
+++ b/winsup/cygwin/include/sys/sysinfo.h
@@ -0,0 +1,27 @@
+/* sys/sysinfo.h
+
+ Copyright 2009 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+/* sys/sysinfo.h header file for Cygwin. */
+
+#ifndef _SYS_SYSINFO_H
+#define _SYS_SYSINFO_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+extern int get_nprocs_conf (void);
+extern int get_nprocs (void);
+extern long get_phys_pages (void);
+extern long get_avphys_pages (void);
+
+__END_DECLS
+
+#endif /* _SYS_SYSINFO_H */
diff --git a/winsup/cygwin/posix.sgml b/winsup/cygwin/posix.sgml
index 06e49d20a..8c88417da 100644
--- a/winsup/cygwin/posix.sgml
+++ b/winsup/cygwin/posix.sgml
@@ -1026,6 +1026,10 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
fopencookie
fremovexattr
fsetxattr
+ get_avphys_pages
+ get_phys_pages
+ get_nprocs
+ get_nprocs_conf
getopt_long
getopt_long_only
getxattr
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);
+}