Skip to content

Commit a3a526d

Browse files
author
Petter Reinholdtsen
committed
Stop trying to parse GNU Hurd kernel version as a Linux kernel version.
This get test_malloc_compliance working on GNU Hurd. This fix is related to #2027.
1 parent 88482f5 commit a3a526d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/common/memory_usage.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ namespace utils {
7474
peakUsage
7575
};
7676

77-
#if __unix__
77+
#if __unix__ && ! defined(__gnu_hurd__)
78+
7879
inline unsigned LinuxKernelVersion()
7980
{
8081
unsigned digit1, digit2, digit3;
@@ -125,9 +126,11 @@ namespace utils {
125126
break;
126127
}
127128
}
128-
// VmPeak is available in kernels staring 2.6.15
129+
#if !defined(__gnu_hurd__)
130+
// VmPeak is available in Linux kernels staring 2.6.15
129131
if (stat != peakUsage || LinuxKernelVersion() >= 2006015)
130132
ASSERT(size, "Invalid /proc/self/status format, pattern not found.");
133+
#endif
131134
fclose(fst);
132135
return size * 1024;
133136
#elif __APPLE__ && !__ARM_ARCH

0 commit comments

Comments
 (0)