[compiler-rt] [compiler-rt] intercept freebsd's cpuset_getdomain api. (PR #76851)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 3 11:30:11 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 7fbc1de9896029636dd572a692ee90ba88285943 ea957915d413439ccc02a163dcd5b9bddc340109 -- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 33d72869f7..1bb09aa13e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -10259,19 +10259,22 @@ INTERCEPTOR(int, cpuset_getaffinity, int level, int which, __int64_t id, SIZE_T
#endif
#if SANITIZER_INTERCEPT_CPUSET_GETDOMAIN
-INTERCEPTOR(int, cpuset_getdomain, int level, int which, __int64 id, SIZE_T cpusetsize, __sanitizer_domainset_t *mask, int *policy) {
+INTERCEPTOR(int, cpuset_getdomain, int level, int which, __int64 id,
+ SIZE_T cpusetsize, __sanitizer_domainset_t *mask, int *policy) {
void *ctx;
- COMMON_INTERCEPTOR_ENTER(ctx, cpuset_getdomain, level, which, id, cpusetsize, mask, policy);
+ COMMON_INTERCEPTOR_ENTER(ctx, cpuset_getdomain, level, which, id, cpusetsize,
+ mask, policy);
int res = REAL(cpuset_getdomain)(level, which, id, cpusetsize, mask, policy);
if (mask && !res) {
- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mask, cpusetsize);
- if (policy) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, policy, sizeof(*policy));
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, mask, cpusetsize);
+ if (policy)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, policy, sizeof(*policy));
}
return res;
}
-#define INIT_CPUSET_GETDOMAIN COMMON_INTERCEPT_FUNCTION(cpuset_getdomain);
+# define INIT_CPUSET_GETDOMAIN COMMON_INTERCEPT_FUNCTION(cpuset_getdomain);
#else
-#define INIT_CPUSET_GETDOMAIN
+# define INIT_CPUSET_GETDOMAIN
#endif
#include "sanitizer_common_interceptors_netbsd_compat.inc"
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
index 27c53c3ec8..fd4c84be5a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
@@ -18,34 +18,34 @@
#include <sys/capsicum.h>
#include <sys/consio.h>
#include <sys/cpuset.h>
-#include <sys/domainset.h>
-#include <sys/filio.h>
-#include <sys/ipc.h>
-#include <sys/kbio.h>
-#include <sys/link_elf.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-#include <sys/mqueue.h>
-#include <sys/msg.h>
-#include <sys/mtio.h>
-#include <sys/ptrace.h>
-#include <sys/resource.h>
-#include <sys/signal.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/soundcard.h>
-#include <sys/stat.h>
-#include <sys/statvfs.h>
-#include <sys/time.h>
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-W#warnings"
-#include <sys/timeb.h>
-#pragma clang diagnostic pop
-#include <sys/times.h>
-#include <sys/timespec.h>
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#include <sys/utsname.h>
+# include <sys/domainset.h>
+# include <sys/filio.h>
+# include <sys/ipc.h>
+# include <sys/kbio.h>
+# include <sys/link_elf.h>
+# include <sys/mman.h>
+# include <sys/mount.h>
+# include <sys/mqueue.h>
+# include <sys/msg.h>
+# include <sys/mtio.h>
+# include <sys/ptrace.h>
+# include <sys/resource.h>
+# include <sys/signal.h>
+# include <sys/socket.h>
+# include <sys/sockio.h>
+# include <sys/soundcard.h>
+# include <sys/stat.h>
+# include <sys/statvfs.h>
+# include <sys/time.h>
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-W#warnings"
+# include <sys/timeb.h>
+# pragma clang diagnostic pop
+# include <sys/times.h>
+# include <sys/timespec.h>
+# include <sys/types.h>
+# include <sys/ucontext.h>
+# include <sys/utsname.h>
//
#include <arpa/inet.h>
#include <net/ethernet.h>
``````````
</details>
https://github.com/llvm/llvm-project/pull/76851
More information about the llvm-commits
mailing list