[compiler-rt] r322646 - Add new interceptor: acct(2)
Kamil Rytarowski via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 17 05:05:14 PST 2018
Author: kamil
Date: Wed Jan 17 05:05:14 2018
New Revision: 322646
URL: http://llvm.org/viewvc/llvm-project?rev=322646&view=rev
Log:
Add new interceptor: acct(2)
Summary:
acct - enable or disable process accounting
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D42066
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=322646&r1=322645&r2=322646&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Wed Jan 17 05:05:14 2018
@@ -6463,6 +6463,19 @@ INTERCEPTOR(wchar_t *, wcsncat, wchar_t
#define INIT_WCSCAT
#endif
+#if SANITIZER_INTERCEPT_ACCT
+INTERCEPTOR(int, acct, const char *file) {
+ void *ctx;
+ COMMON_INTERCEPTOR_ENTER(ctx, acct, file);
+ if (file)
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, file, REAL(strlen)(file) + 1);
+ return REAL(acct)(file);
+}
+#define INIT_ACCT COMMON_INTERCEPT_FUNCTION(acct)
+#else
+#define INIT_ACCT
+#endif
+
static void InitializeCommonInterceptors() {
static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap();
@@ -6674,6 +6687,7 @@ static void InitializeCommonInterceptors
INIT_GETLOADAVG;
INIT_WCSLEN;
INIT_WCSCAT;
+ INIT_ACCT;
#if SANITIZER_NETBSD
COMMON_INTERCEPT_FUNCTION(__libc_mutex_lock);
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=322646&r1=322645&r2=322646&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Jan 17 05:05:14 2018
@@ -432,4 +432,6 @@
#define SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION (!SI_WINDOWS && SI_NOT_FUCHSIA)
#define SANITIZER_INTERCEPT_BSD_SIGNAL SI_ANDROID
+#define SANITIZER_INTERCEPT_ACCT SI_NETBSD
+
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
More information about the llvm-commits
mailing list