Skip to content

Commit ad924a9

Browse files
Add page size system features
1 parent 2d9b213 commit ad924a9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/libstore/globals.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include <sys/sysctl.h>
3636
#endif
3737

38+
#include <sys/auxv.h>
39+
3840
#include "strings.hh"
3941

4042
namespace nix {
@@ -196,6 +198,11 @@ StringSet Settings::getDefaultSystemFeatures()
196198
features.insert("apple-virt");
197199
#endif
198200

201+
unsigned long pgsize = getauxval(AT_PAGESZ);
202+
for (; pgsize <= (64 * 1024); pgsize *= 2) {
203+
features.insert(fmt("pages-%1%k", pgsize / 1024));
204+
}
205+
199206
return features;
200207
}
201208

0 commit comments

Comments
 (0)