summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6bec348)
raw | patch | inline | side by side (parent: 6bec348)
author | Tao Bao <tbao@google.com> | |
Thu, 4 Dec 2014 23:24:28 +0000 (15:24 -0800) | ||
committer | Tao Bao <tbao@google.com> | |
Thu, 4 Dec 2014 23:24:28 +0000 (15:24 -0800) |
Several cache related queries are added, such as
_SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE and etc. For the
moment, we always return 0 for these queries.
Change-Id: I36f67af8128672d8c1eef49d6f2431cca5a94719
_SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE and etc. For the
moment, we always return 0 for these queries.
Change-Id: I36f67af8128672d8c1eef49d6f2431cca5a94719
libc/bionic/sysconf.cpp | patch | blob | history | |
libc/include/sys/sysconf.h | patch | blob | history |
index 67f48e7f3922b8685580b31c899f99c4c2e62f0d..418072107b56809cb9eb72440afe314d284af6ec 100644 (file)
--- a/libc/bionic/sysconf.cpp
+++ b/libc/bionic/sysconf.cpp
case _SC_XOPEN_STREAMS: return -1; // Obsolescent in POSIX.1-2008.
case _SC_XOPEN_UUCP: return -1;
+ // We do not have actual implementations for cache queries.
+ // It's valid to return 0 as the result is unknown.
+ case _SC_LEVEL1_ICACHE_SIZE: return 0;
+ case _SC_LEVEL1_ICACHE_ASSOC: return 0;
+ case _SC_LEVEL1_ICACHE_LINESIZE: return 0;
+ case _SC_LEVEL1_DCACHE_SIZE: return 0;
+ case _SC_LEVEL1_DCACHE_ASSOC: return 0;
+ case _SC_LEVEL1_DCACHE_LINESIZE: return 0;
+ case _SC_LEVEL2_CACHE_SIZE: return 0;
+ case _SC_LEVEL2_CACHE_ASSOC: return 0;
+ case _SC_LEVEL2_CACHE_LINESIZE: return 0;
+ case _SC_LEVEL3_CACHE_SIZE: return 0;
+ case _SC_LEVEL3_CACHE_ASSOC: return 0;
+ case _SC_LEVEL3_CACHE_LINESIZE: return 0;
+ case _SC_LEVEL4_CACHE_SIZE: return 0;
+ case _SC_LEVEL4_CACHE_ASSOC: return 0;
+ case _SC_LEVEL4_CACHE_LINESIZE: return 0;
+
default:
// Posix says EINVAL is the only error that shall be returned,
// but glibc uses ENOSYS.
index 8aa506ea39ce492b59bf42c167207c523d3bad87..ca32132fabfe65d23ef48bf7a117add2eb1827d6 100644 (file)
#define _SC_XOPEN_STREAMS 0x008d
#define _SC_XOPEN_UUCP 0x008e
+#define _SC_LEVEL1_ICACHE_SIZE 0x008f
+#define _SC_LEVEL1_ICACHE_ASSOC 0x0090
+#define _SC_LEVEL1_ICACHE_LINESIZE 0x0091
+#define _SC_LEVEL1_DCACHE_SIZE 0x0092
+#define _SC_LEVEL1_DCACHE_ASSOC 0x0093
+#define _SC_LEVEL1_DCACHE_LINESIZE 0x0094
+#define _SC_LEVEL2_CACHE_SIZE 0x0095
+#define _SC_LEVEL2_CACHE_ASSOC 0x0096
+#define _SC_LEVEL2_CACHE_LINESIZE 0x0097
+#define _SC_LEVEL3_CACHE_SIZE 0x0098
+#define _SC_LEVEL3_CACHE_ASSOC 0x0099
+#define _SC_LEVEL3_CACHE_LINESIZE 0x009a
+#define _SC_LEVEL4_CACHE_SIZE 0x009b
+#define _SC_LEVEL4_CACHE_ASSOC 0x009c
+#define _SC_LEVEL4_CACHE_LINESIZE 0x009d
+
long sysconf(int);
__END_DECLS