File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,9 @@ add_entrypoint_object(
402402 ../sysconf.h
403403 DEPENDS
404404 libc.include .unistd
405+ libc.include .sys_auxv
405406 libc.src.errno.errno
407+ libc.src.sys.auxv.getauxval
406408)
407409
408410add_entrypoint_object(
Original file line number Diff line number Diff line change 1111#include " src/__support/common.h"
1212
1313#include " src/errno/libc_errno.h"
14- #include < linux/param.h> // For EXEC_PAGESIZE.
14+ #include " src/sys/auxv/getauxval.h"
15+ #include < sys/auxv.h>
1516#include < unistd.h>
1617
1718namespace LIBC_NAMESPACE {
1819
1920LLVM_LIBC_FUNCTION (long , sysconf, (int name)) {
2021 long ret = 0 ;
21- if (name == _SC_PAGESIZE) {
22- // TODO: get this information from the auxvector.
23- return EXEC_PAGESIZE;
24- }
22+ if (name == _SC_PAGESIZE)
23+ return static_cast <long >(getauxval (AT_PAGESZ));
24+
2525 // TODO: Complete the rest of the sysconf options.
2626 if (ret < 0 ) {
2727 libc_errno = EINVAL;
You can’t perform that action at this time.
0 commit comments