1 $NetBSD: patch-jdk_src_solaris_bin_ergo.c,v 1.1 2015/02/08 08:41:25 tnn Exp $
3 No _SC_PHYS_PAGES on NetBSD < 6.
4 we could use the hw.physmem64 sysctl instead of returning 0,
5 although I don't think this code is actually used.
7 --- jdk/src/solaris/bin/ergo.c.orig 2015-02-02 15:37:12.000000000 +0000
8 +++ jdk/src/solaris/bin/ergo.c
9 @@ -100,7 +100,11 @@ ServerClassMachineImpl(void) {
10 /* Compute physical memory by asking the OS */
12 physical_memory(void) {
13 +#ifdef _SC_PHYS_PAGES
14 const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES);
16 + const uint64_t pages = 0;
18 const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
19 const uint64_t result = pages * page_size;
20 # define UINT64_FORMAT "%" PRIu64