mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Create variables for page size
This commit is contained in:
parent
23dfb79d33
commit
567d8fe32d
34 changed files with 137 additions and 101 deletions
|
@ -16,13 +16,9 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/getauxval.internal.h"
|
||||
#include "libc/nt/struct/systeminfo.h"
|
||||
#include "libc/nt/systeminfo.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sysv/consts/auxv.h"
|
||||
|
||||
/**
|
||||
* Returns auxiliary value.
|
||||
|
@ -36,22 +32,6 @@
|
|||
unsigned long getauxval(unsigned long key) {
|
||||
struct AuxiliaryValue x;
|
||||
x = __getauxval(key);
|
||||
if (key == AT_PAGESZ) {
|
||||
if (!x.isfound) {
|
||||
if (!IsWindows()) {
|
||||
#ifdef __aarch64__
|
||||
x.value = 16384;
|
||||
#else
|
||||
x.value = 4096;
|
||||
#endif
|
||||
} else {
|
||||
struct NtSystemInfo si;
|
||||
GetSystemInfo(&si);
|
||||
x.value = si.dwPageSize;
|
||||
}
|
||||
}
|
||||
x.isfound = true;
|
||||
}
|
||||
if (x.isfound) {
|
||||
return x.value;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue