[compiler-rt] r343370 - Switch sanitizer_procmaps_bsd to internal_sysctl
Kamil Rytarowski via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 29 00:45:03 PDT 2018
Author: kamil
Date: Sat Sep 29 00:45:03 2018
New Revision: 343370
URL: http://llvm.org/viewvc/llvm-project?rev=343370&view=rev
Log:
Switch sanitizer_procmaps_bsd to internal_sysctl
Summary:
Stop using directly sysctl(3) routines in sanitizer_procmaps_bsd
and replace it with internal_sysctl().
This will allow to install interceptors for sysctl(3).
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D52646
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_bsd.cc?rev=343370&r1=343369&r2=343370&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_bsd.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_bsd.cc Sat Sep 29 00:45:03 2018
@@ -67,8 +67,8 @@ void ReadProcMaps(ProcSelfMapsBuff *proc
#endif
};
- size_t Size = 0;
- int Err = sysctl(Mib, ARRAY_SIZE(Mib), NULL, &Size, NULL, 0);
+ uptr Size = 0;
+ int Err = internal_sysctl(Mib, ARRAY_SIZE(Mib), NULL, &Size, NULL, 0);
CHECK_EQ(Err, 0);
CHECK_GT(Size, 0);
@@ -76,7 +76,7 @@ void ReadProcMaps(ProcSelfMapsBuff *proc
size_t MmapedSize = Size * 4 / 3;
void *VmMap = MmapOrDie(MmapedSize, "ReadProcMaps()");
Size = MmapedSize;
- Err = sysctl(Mib, ARRAY_SIZE(Mib), VmMap, &Size, NULL, 0);
+ Err = internal_sysctl(Mib, ARRAY_SIZE(Mib), VmMap, &Size, NULL, 0);
CHECK_EQ(Err, 0);
proc_maps->data = (char *)VmMap;
#else
@@ -88,7 +88,7 @@ void ReadProcMaps(ProcSelfMapsBuff *proc
if (Size > 0x10000)
Size = 0x10000;
Size = (Size / sizeof(struct kinfo_vmentry)) * sizeof(struct kinfo_vmentry);
- Err = sysctl(Mib, ARRAY_SIZE(Mib), Mem, &Size, NULL, 0);
+ Err = internal_sysctl(Mib, ARRAY_SIZE(Mib), Mem, &Size, NULL, 0);
CHECK_EQ(Err, 0);
MmapedSize = Size;
proc_maps->data = Mem;
More information about the llvm-commits
mailing list