Create variables for page size

This commit is contained in:
Justine Tunney 2024-07-18 21:02:59 -07:00
parent 23dfb79d33
commit 567d8fe32d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
34 changed files with 137 additions and 101 deletions

View file

@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
vi: set et ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi
Copyright 2023 Justine Alexandra Roberts Tunney
Copyright 2024 Justine Alexandra Roberts Tunney
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
@ -17,12 +17,11 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/auxv.h"
/**
* Returns granularity of memory manager.
* Returns system page size.
* @see sysconf(_SC_PAGE_SIZE) which is portable
*/
int getpagesize(void) {
return getauxval(AT_PAGESZ);
return __pagesize;
}