File tree 1 file changed +16
-0
lines changed
compiler-rt/lib/msan/tests
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 21
21
#include " sanitizer/allocator_interface.h"
22
22
#include " sanitizer/msan_interface.h"
23
23
24
+ #if defined(__FreeBSD__)
25
+ # define _KERNEL // To declare 'shminfo' structure.
26
+ # include < sys/shm.h>
27
+ # undef _KERNEL
28
+ extern " C" {
29
+ // <sys/shm.h> doesn't declare these functions in _KERNEL mode.
30
+ void *shmat (int , const void *, int );
31
+ int shmget (key_t , size_t , int );
32
+ int shmctl (int , int , struct shmid_ds *);
33
+ int shmdt (const void *);
34
+ }
35
+ #endif
36
+
24
37
#include < inttypes.h>
25
38
#include < stdlib.h>
26
39
#include < stdarg.h>
@@ -1165,6 +1178,8 @@ TEST(MemorySanitizer, shmctl) {
1165
1178
ASSERT_GT (res, -1 );
1166
1179
EXPECT_NOT_POISONED (ds);
1167
1180
1181
+ // FreeBSD does not support shmctl(IPC_INFO) and shmctl(SHM_INFO).
1182
+ #if !defined(__FreeBSD__)
1168
1183
struct shminfo si;
1169
1184
res = shmctl (id, IPC_INFO, (struct shmid_ds *)&si);
1170
1185
ASSERT_GT (res, -1 );
@@ -1174,6 +1189,7 @@ TEST(MemorySanitizer, shmctl) {
1174
1189
res = shmctl (id, SHM_INFO, (struct shmid_ds *)&s_i);
1175
1190
ASSERT_GT (res, -1 );
1176
1191
EXPECT_NOT_POISONED (s_i);
1192
+ #endif
1177
1193
1178
1194
res = shmctl (id, IPC_RMID, 0 );
1179
1195
ASSERT_GT (res, -1 );
You can’t perform that action at this time.
0 commit comments