File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,9 @@ add_entrypoint_object(
402
402
../sysconf.h
403
403
DEPENDS
404
404
libc.include .unistd
405
+ libc.include .sys_auxv
405
406
libc.src.errno.errno
407
+ libc.src.sys.auxv.getauxval
406
408
)
407
409
408
410
add_entrypoint_object(
Original file line number Diff line number Diff line change 11
11
#include " src/__support/common.h"
12
12
13
13
#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>
15
16
#include < unistd.h>
16
17
17
18
namespace LIBC_NAMESPACE {
18
19
19
20
LLVM_LIBC_FUNCTION (long , sysconf, (int name)) {
20
21
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
+
25
25
// TODO: Complete the rest of the sysconf options.
26
26
if (ret < 0 ) {
27
27
libc_errno = EINVAL;
You can’t perform that action at this time.
0 commit comments