-
Notifications
You must be signed in to change notification settings - Fork 15.1k
libc: Introduce calls to sysconf to get page size. #163462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,12 +16,13 @@ | |||||
| #include "test/UnitTest/ErrnoSetterMatcher.h" | ||||||
| #include "test/UnitTest/Test.h" | ||||||
|
|
||||||
| #include <unistd.h> | ||||||
|
|
||||||
| using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails; | ||||||
| using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds; | ||||||
| using LlvmLibcMincoreTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest; | ||||||
|
|
||||||
| // TODO: Replace with sysconf call once the function is properly implemented. | ||||||
| constexpr size_t PAGE_SIZE = 4096; | ||||||
| const size_t PAGE_SIZE = sysconf(_SC_PAGESIZE); | ||||||
|
||||||
| const size_t PAGE_SIZE = sysconf(_SC_PAGESIZE); | |
| const size_t PAGE_SIZE = LIBC_NAMESPACE::sysconf(_SC_PAGESIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine for tests, but just be aware that this changes the behavior to require a global constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I also figured that would be fine for tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be the LLVM-libc sysconf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done