We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d9b213 commit 4a4a76cCopy full SHA for 4a4a76c
src/libstore/globals.cc
@@ -35,6 +35,10 @@
35
#include <sys/sysctl.h>
36
#endif
37
38
+#ifdef __linux__
39
+#include <sys/auxv.h>
40
+#endif
41
+
42
#include "strings.hh"
43
44
namespace nix {
@@ -196,6 +200,16 @@ StringSet Settings::getDefaultSystemFeatures()
196
200
features.insert("apple-virt");
197
201
198
202
203
+ #if __linux__
204
+ unsigned long pgsize = getauxval(AT_PAGESZ);
205
+ #else
206
+ unsigned long pgsize = getpagesize();
207
+ #endif
208
209
+ for (; pgsize <= (64 * 1024); pgsize *= 2) {
210
+ features.insert(fmt("pages-%1%k", pgsize / 1024));
211
+ }
212
199
213
return features;
214
}
215
0 commit comments