This is an archive of the discontinued LLVM Phabricator instance.

[libc] add madvise and posix_madvise
ClosedPublic

Authored by michaelrj on Sep 22 2022, 3:55 PM.

Details

Summary

Add the madvise and posix_madvise syscall wrappers and tests.

Diff Detail

Event Timeline

michaelrj created this revision.Sep 22 2022, 3:55 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 22 2022, 3:55 PM
michaelrj requested review of this revision.Sep 22 2022, 3:55 PM
sivachandra accepted this revision.Sep 22 2022, 10:07 PM
sivachandra added inline comments.
libc/src/sys/mman/linux/posix_madvise.cpp
30

To be safe, may be we should:

return ret_val < 0 ? -ret_val : 0;
libc/test/src/sys/mman/linux/posix_madvise_test.cpp
50

Since errno not affected, we should use EXPECT_EQ. Here and everywhere above.

This revision is now accepted and ready to land.Sep 22 2022, 10:07 PM
michaelrj updated this revision to Diff 462521.Sep 23 2022, 9:33 AM
michaelrj marked 2 inline comments as done.

address comments

This revision was automatically updated to reflect the committed changes.