1 | //===-- sanitizer_platform_limits_posix.h ---------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // This file is a part of Sanitizer common code. |
10 | // |
11 | // Sizes and layouts of platform-specific POSIX data structures. |
12 | //===----------------------------------------------------------------------===// |
13 | |
14 | #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H |
15 | #define SANITIZER_PLATFORM_LIMITS_POSIX_H |
16 | |
17 | #if SANITIZER_LINUX || SANITIZER_APPLE |
18 | |
19 | #include "sanitizer_internal_defs.h" |
20 | #include "sanitizer_platform.h" |
21 | #include "sanitizer_mallinfo.h" |
22 | |
23 | #if SANITIZER_APPLE |
24 | #include <sys/cdefs.h> |
25 | #if !__DARWIN_ONLY_64_BIT_INO_T |
26 | #define SANITIZER_HAS_STAT64 1 |
27 | #define SANITIZER_HAS_STATFS64 1 |
28 | #else |
29 | #define SANITIZER_HAS_STAT64 0 |
30 | #define SANITIZER_HAS_STATFS64 0 |
31 | #endif |
32 | #elif SANITIZER_GLIBC || SANITIZER_ANDROID |
33 | #define SANITIZER_HAS_STAT64 1 |
34 | #define SANITIZER_HAS_STATFS64 1 |
35 | #endif |
36 | |
37 | #if defined(__sparc__) |
38 | // FIXME: This can't be included from tsan which does not support sparc yet. |
39 | #include "sanitizer_glibc_version.h" |
40 | #endif |
41 | |
42 | # define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle)) |
43 | |
44 | namespace __sanitizer { |
45 | extern unsigned struct_utsname_sz; |
46 | extern unsigned struct_stat_sz; |
47 | #if SANITIZER_HAS_STAT64 |
48 | extern unsigned struct_stat64_sz; |
49 | #endif |
50 | extern unsigned struct_rusage_sz; |
51 | extern unsigned siginfo_t_sz; |
52 | extern unsigned struct_itimerval_sz; |
53 | extern unsigned pthread_t_sz; |
54 | extern unsigned pthread_mutex_t_sz; |
55 | extern unsigned pthread_cond_t_sz; |
56 | extern unsigned pid_t_sz; |
57 | extern unsigned timeval_sz; |
58 | extern unsigned uid_t_sz; |
59 | extern unsigned gid_t_sz; |
60 | extern unsigned mbstate_t_sz; |
61 | extern unsigned struct_timezone_sz; |
62 | extern unsigned struct_tms_sz; |
63 | extern unsigned struct_itimerspec_sz; |
64 | extern unsigned struct_sigevent_sz; |
65 | extern unsigned struct_stack_t_sz; |
66 | extern unsigned struct_sched_param_sz; |
67 | #if SANITIZER_HAS_STATFS64 |
68 | extern unsigned struct_statfs64_sz; |
69 | #endif |
70 | extern unsigned struct_regex_sz; |
71 | extern unsigned struct_regmatch_sz; |
72 | |
73 | #if !SANITIZER_ANDROID |
74 | extern unsigned struct_fstab_sz; |
75 | extern unsigned struct_statfs_sz; |
76 | extern unsigned struct_sockaddr_sz; |
77 | unsigned ucontext_t_sz(void *uctx); |
78 | # endif // !SANITIZER_ANDROID |
79 | |
80 | # if SANITIZER_LINUX |
81 | |
82 | # if defined(__x86_64__) |
83 | const unsigned struct_kernel_stat_sz = 144; |
84 | const unsigned struct_kernel_stat64_sz = 0; |
85 | #elif defined(__i386__) |
86 | const unsigned struct_kernel_stat_sz = 64; |
87 | const unsigned struct_kernel_stat64_sz = 96; |
88 | #elif defined(__arm__) |
89 | const unsigned struct_kernel_stat_sz = 64; |
90 | const unsigned struct_kernel_stat64_sz = 104; |
91 | #elif defined(__aarch64__) |
92 | const unsigned struct_kernel_stat_sz = 128; |
93 | const unsigned struct_kernel_stat64_sz = 104; |
94 | #elif defined(__powerpc__) && !defined(__powerpc64__) |
95 | const unsigned struct_kernel_stat_sz = 72; |
96 | const unsigned struct_kernel_stat64_sz = 104; |
97 | #elif defined(__powerpc64__) |
98 | const unsigned struct_kernel_stat_sz = 144; |
99 | const unsigned struct_kernel_stat64_sz = 104; |
100 | #elif defined(__mips__) |
101 | const unsigned struct_kernel_stat_sz = |
102 | SANITIZER_ANDROID |
103 | ? FIRST_32_SECOND_64(104, 128) |
104 | : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216); |
105 | const unsigned struct_kernel_stat64_sz = 104; |
106 | #elif defined(__s390__) && !defined(__s390x__) |
107 | const unsigned struct_kernel_stat_sz = 64; |
108 | const unsigned struct_kernel_stat64_sz = 104; |
109 | #elif defined(__s390x__) |
110 | const unsigned struct_kernel_stat_sz = 144; |
111 | const unsigned struct_kernel_stat64_sz = 0; |
112 | #elif defined(__sparc__) && defined(__arch64__) |
113 | const unsigned struct___old_kernel_stat_sz = 0; |
114 | const unsigned struct_kernel_stat_sz = 104; |
115 | const unsigned struct_kernel_stat64_sz = 144; |
116 | #elif defined(__sparc__) && !defined(__arch64__) |
117 | const unsigned struct___old_kernel_stat_sz = 0; |
118 | const unsigned struct_kernel_stat_sz = 64; |
119 | const unsigned struct_kernel_stat64_sz = 104; |
120 | #elif SANITIZER_RISCV64 |
121 | const unsigned struct_kernel_stat_sz = 128; |
122 | const unsigned struct_kernel_stat64_sz = 0; // RISCV64 does not use stat64 |
123 | # elif defined(__hexagon__) |
124 | const unsigned struct_kernel_stat_sz = 128; |
125 | const unsigned struct_kernel_stat64_sz = 0; |
126 | # elif defined(__loongarch__) |
127 | const unsigned struct_kernel_stat_sz = 128; |
128 | const unsigned struct_kernel_stat64_sz = 0; |
129 | # endif |
130 | struct __sanitizer_perf_event_attr { |
131 | unsigned type; |
132 | unsigned size; |
133 | // More fields that vary with the kernel version. |
134 | }; |
135 | |
136 | extern unsigned struct_epoll_event_sz; |
137 | extern unsigned struct_sysinfo_sz; |
138 | extern unsigned ; |
139 | extern unsigned __user_cap_data_struct_sz(void *hdrp); |
140 | extern unsigned struct_new_utsname_sz; |
141 | extern unsigned struct_old_utsname_sz; |
142 | extern unsigned struct_oldold_utsname_sz; |
143 | |
144 | const unsigned struct_kexec_segment_sz = 4 * sizeof(unsigned long); |
145 | #endif // SANITIZER_LINUX |
146 | |
147 | #if SANITIZER_LINUX |
148 | |
149 | #if defined(__powerpc64__) || defined(__s390__) || defined(__loongarch__) |
150 | const unsigned struct___old_kernel_stat_sz = 0; |
151 | #elif !defined(__sparc__) |
152 | const unsigned struct___old_kernel_stat_sz = 32; |
153 | #endif |
154 | |
155 | extern unsigned struct_rlimit_sz; |
156 | extern unsigned struct_utimbuf_sz; |
157 | extern unsigned struct_timespec_sz; |
158 | |
159 | struct __sanitizer_iocb { |
160 | u64 aio_data; |
161 | u32 aio_key_or_aio_reserved1; // Simply crazy. |
162 | u32 aio_reserved1_or_aio_key; // Luckily, we don't need these. |
163 | u16 aio_lio_opcode; |
164 | s16 aio_reqprio; |
165 | u32 aio_fildes; |
166 | u64 aio_buf; |
167 | u64 aio_nbytes; |
168 | s64 aio_offset; |
169 | u64 aio_reserved2; |
170 | u64 aio_reserved3; |
171 | }; |
172 | |
173 | struct __sanitizer_io_event { |
174 | u64 data; |
175 | u64 obj; |
176 | u64 res; |
177 | u64 res2; |
178 | }; |
179 | |
180 | const unsigned iocb_cmd_pread = 0; |
181 | const unsigned iocb_cmd_pwrite = 1; |
182 | const unsigned iocb_cmd_preadv = 7; |
183 | const unsigned iocb_cmd_pwritev = 8; |
184 | |
185 | struct __sanitizer___sysctl_args { |
186 | int *name; |
187 | int nlen; |
188 | void *oldval; |
189 | uptr *oldlenp; |
190 | void *newval; |
191 | uptr newlen; |
192 | unsigned long ___unused[4]; |
193 | }; |
194 | |
195 | const unsigned old_sigset_t_sz = sizeof(unsigned long); |
196 | |
197 | struct __sanitizer_sem_t { |
198 | #if SANITIZER_ANDROID && defined(_LP64) |
199 | int data[4]; |
200 | #elif SANITIZER_ANDROID && !defined(_LP64) |
201 | int data; |
202 | #elif SANITIZER_LINUX |
203 | uptr data[4]; |
204 | #endif |
205 | }; |
206 | #endif // SANITIZER_LINUX |
207 | |
208 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
209 | extern unsigned struct_ustat_sz; |
210 | extern unsigned struct_rlimit64_sz; |
211 | extern unsigned struct_statvfs64_sz; |
212 | |
213 | struct __sanitizer_ipc_perm { |
214 | int __key; |
215 | int uid; |
216 | int gid; |
217 | int cuid; |
218 | int cgid; |
219 | #ifdef __powerpc__ |
220 | unsigned mode; |
221 | unsigned __seq; |
222 | u64 __unused1; |
223 | u64 __unused2; |
224 | #elif defined(__sparc__) |
225 | unsigned mode; |
226 | unsigned short __pad2; |
227 | unsigned short __seq; |
228 | unsigned long long __unused1; |
229 | unsigned long long __unused2; |
230 | #else |
231 | unsigned int mode; |
232 | unsigned short __seq; |
233 | unsigned short __pad2; |
234 | #if defined(__x86_64__) && !defined(_LP64) |
235 | u64 __unused1; |
236 | u64 __unused2; |
237 | #else |
238 | unsigned long __unused1; |
239 | unsigned long __unused2; |
240 | #endif |
241 | #endif |
242 | }; |
243 | |
244 | struct __sanitizer_shmid_ds { |
245 | __sanitizer_ipc_perm shm_perm; |
246 | #if defined(__sparc__) |
247 | #if !defined(__arch64__) |
248 | u32 __pad1; |
249 | #endif |
250 | long shm_atime; |
251 | #if !defined(__arch64__) |
252 | u32 __pad2; |
253 | #endif |
254 | long shm_dtime; |
255 | #if !defined(__arch64__) |
256 | u32 __pad3; |
257 | #endif |
258 | long shm_ctime; |
259 | uptr shm_segsz; |
260 | int shm_cpid; |
261 | int shm_lpid; |
262 | unsigned long shm_nattch; |
263 | unsigned long __glibc_reserved1; |
264 | unsigned long __glibc_reserved2; |
265 | #else |
266 | #ifndef __powerpc__ |
267 | uptr shm_segsz; |
268 | #elif !defined(__powerpc64__) |
269 | uptr __unused0; |
270 | #endif |
271 | #if defined(__x86_64__) && !defined(_LP64) |
272 | u64 shm_atime; |
273 | u64 shm_dtime; |
274 | u64 shm_ctime; |
275 | #else |
276 | uptr shm_atime; |
277 | #if !defined(_LP64) && !defined(__mips__) |
278 | uptr __unused1; |
279 | #endif |
280 | uptr shm_dtime; |
281 | #if !defined(_LP64) && !defined(__mips__) |
282 | uptr __unused2; |
283 | #endif |
284 | uptr shm_ctime; |
285 | #if !defined(_LP64) && !defined(__mips__) |
286 | uptr __unused3; |
287 | #endif |
288 | #endif |
289 | #ifdef __powerpc__ |
290 | uptr shm_segsz; |
291 | #endif |
292 | int shm_cpid; |
293 | int shm_lpid; |
294 | #if defined(__x86_64__) && !defined(_LP64) |
295 | u64 shm_nattch; |
296 | u64 __unused4; |
297 | u64 __unused5; |
298 | #else |
299 | uptr shm_nattch; |
300 | uptr __unused4; |
301 | uptr __unused5; |
302 | #endif |
303 | #endif |
304 | }; |
305 | #endif |
306 | |
307 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
308 | extern unsigned struct_msqid_ds_sz; |
309 | extern unsigned struct_mq_attr_sz; |
310 | extern unsigned struct_timex_sz; |
311 | extern unsigned struct_statvfs_sz; |
312 | #endif // SANITIZER_LINUX && !SANITIZER_ANDROID |
313 | |
314 | struct __sanitizer_iovec { |
315 | void *iov_base; |
316 | uptr iov_len; |
317 | }; |
318 | |
319 | #if !SANITIZER_ANDROID |
320 | struct __sanitizer_ifaddrs { |
321 | struct __sanitizer_ifaddrs *ifa_next; |
322 | char *ifa_name; |
323 | unsigned int ifa_flags; |
324 | void *ifa_addr; // (struct sockaddr *) |
325 | void *ifa_netmask; // (struct sockaddr *) |
326 | // This is a union on Linux. |
327 | # ifdef ifa_dstaddr |
328 | # undef ifa_dstaddr |
329 | # endif |
330 | void *ifa_dstaddr; // (struct sockaddr *) |
331 | void *ifa_data; |
332 | }; |
333 | #endif // !SANITIZER_ANDROID |
334 | |
335 | #if SANITIZER_APPLE |
336 | typedef unsigned long __sanitizer_pthread_key_t; |
337 | #else |
338 | typedef unsigned __sanitizer_pthread_key_t; |
339 | #endif |
340 | |
341 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
342 | |
343 | struct __sanitizer_XDR { |
344 | int x_op; |
345 | void *x_ops; |
346 | uptr x_public; |
347 | uptr x_private; |
348 | uptr x_base; |
349 | unsigned x_handy; |
350 | }; |
351 | |
352 | const int __sanitizer_XDR_ENCODE = 0; |
353 | const int __sanitizer_XDR_DECODE = 1; |
354 | const int __sanitizer_XDR_FREE = 2; |
355 | #endif |
356 | |
357 | struct __sanitizer_passwd { |
358 | char *pw_name; |
359 | char *pw_passwd; |
360 | int pw_uid; |
361 | int pw_gid; |
362 | #if SANITIZER_APPLE |
363 | long pw_change; |
364 | char *pw_class; |
365 | #endif |
366 | #if !(SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32)) |
367 | char *pw_gecos; |
368 | #endif |
369 | char *pw_dir; |
370 | char *pw_shell; |
371 | #if SANITIZER_APPLE |
372 | long pw_expire; |
373 | #endif |
374 | }; |
375 | |
376 | struct __sanitizer_group { |
377 | char *gr_name; |
378 | char *gr_passwd; |
379 | int gr_gid; |
380 | char **gr_mem; |
381 | }; |
382 | |
383 | # if (SANITIZER_LINUX && !SANITIZER_GLIBC && !SANITIZER_ANDROID) || \ |
384 | (defined(__x86_64__) && !defined(_LP64)) || defined(__hexagon__) |
385 | typedef long long __sanitizer_time_t; |
386 | #else |
387 | typedef long __sanitizer_time_t; |
388 | #endif |
389 | |
390 | typedef long __sanitizer_suseconds_t; |
391 | |
392 | struct __sanitizer_timeval { |
393 | __sanitizer_time_t tv_sec; |
394 | __sanitizer_suseconds_t tv_usec; |
395 | }; |
396 | |
397 | struct __sanitizer_itimerval { |
398 | struct __sanitizer_timeval it_interval; |
399 | struct __sanitizer_timeval it_value; |
400 | }; |
401 | |
402 | struct __sanitizer_timeb { |
403 | __sanitizer_time_t time; |
404 | unsigned short millitm; |
405 | short timezone; |
406 | short dstflag; |
407 | }; |
408 | |
409 | struct __sanitizer_ether_addr { |
410 | u8 octet[6]; |
411 | }; |
412 | |
413 | struct __sanitizer_tm { |
414 | int tm_sec; |
415 | int tm_min; |
416 | int tm_hour; |
417 | int tm_mday; |
418 | int tm_mon; |
419 | int tm_year; |
420 | int tm_wday; |
421 | int tm_yday; |
422 | int tm_isdst; |
423 | long int tm_gmtoff; |
424 | const char *tm_zone; |
425 | }; |
426 | |
427 | #if SANITIZER_LINUX |
428 | struct __sanitizer_mntent { |
429 | char *mnt_fsname; |
430 | char *mnt_dir; |
431 | char *mnt_type; |
432 | char *mnt_opts; |
433 | int mnt_freq; |
434 | int mnt_passno; |
435 | }; |
436 | |
437 | struct __sanitizer_file_handle { |
438 | unsigned int handle_bytes; |
439 | int handle_type; |
440 | unsigned char f_handle[1]; // variable sized |
441 | }; |
442 | #endif |
443 | |
444 | #if SANITIZER_APPLE |
445 | struct __sanitizer_msghdr { |
446 | void *msg_name; |
447 | unsigned msg_namelen; |
448 | struct __sanitizer_iovec *msg_iov; |
449 | unsigned msg_iovlen; |
450 | void *msg_control; |
451 | unsigned msg_controllen; |
452 | int msg_flags; |
453 | }; |
454 | struct __sanitizer_cmsghdr { |
455 | unsigned cmsg_len; |
456 | int cmsg_level; |
457 | int cmsg_type; |
458 | }; |
459 | #else |
460 | // In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but |
461 | // many implementations don't conform to the standard. |
462 | struct __sanitizer_msghdr { |
463 | void *msg_name; |
464 | unsigned msg_namelen; |
465 | struct __sanitizer_iovec *msg_iov; |
466 | uptr msg_iovlen; |
467 | void *msg_control; |
468 | uptr msg_controllen; |
469 | int msg_flags; |
470 | }; |
471 | struct __sanitizer_cmsghdr { |
472 | uptr cmsg_len; |
473 | int cmsg_level; |
474 | int cmsg_type; |
475 | }; |
476 | #endif |
477 | |
478 | #if SANITIZER_LINUX |
479 | struct __sanitizer_mmsghdr { |
480 | __sanitizer_msghdr msg_hdr; |
481 | unsigned int msg_len; |
482 | }; |
483 | #endif |
484 | |
485 | #if SANITIZER_APPLE |
486 | struct __sanitizer_dirent { |
487 | unsigned long long d_ino; |
488 | unsigned long long d_seekoff; |
489 | unsigned short d_reclen; |
490 | // more fields that we don't care about |
491 | }; |
492 | # elif (SANITIZER_LINUX && !SANITIZER_GLIBC) || defined(__x86_64__) || \ |
493 | defined(__hexagon__) |
494 | struct __sanitizer_dirent { |
495 | unsigned long long d_ino; |
496 | unsigned long long d_off; |
497 | unsigned short d_reclen; |
498 | // more fields that we don't care about |
499 | }; |
500 | # else |
501 | struct __sanitizer_dirent { |
502 | uptr d_ino; |
503 | uptr d_off; |
504 | unsigned short d_reclen; |
505 | // more fields that we don't care about |
506 | }; |
507 | # endif |
508 | |
509 | # if SANITIZER_GLIBC |
510 | struct __sanitizer_dirent64 { |
511 | unsigned long long d_ino; |
512 | unsigned long long d_off; |
513 | unsigned short d_reclen; |
514 | // more fields that we don't care about |
515 | }; |
516 | #endif |
517 | |
518 | #if defined(__x86_64__) && !defined(_LP64) |
519 | typedef long long __sanitizer_clock_t; |
520 | #else |
521 | typedef long __sanitizer_clock_t; |
522 | #endif |
523 | |
524 | #if SANITIZER_LINUX |
525 | typedef int __sanitizer_clockid_t; |
526 | typedef unsigned long long __sanitizer_eventfd_t; |
527 | #endif |
528 | |
529 | #if SANITIZER_LINUX |
530 | # if defined(_LP64) || defined(__x86_64__) || defined(__powerpc__) || \ |
531 | defined(__mips__) || defined(__hexagon__) |
532 | typedef unsigned __sanitizer___kernel_uid_t; |
533 | typedef unsigned __sanitizer___kernel_gid_t; |
534 | #else |
535 | typedef unsigned short __sanitizer___kernel_uid_t; |
536 | typedef unsigned short __sanitizer___kernel_gid_t; |
537 | #endif |
538 | #if defined(__x86_64__) && !defined(_LP64) |
539 | typedef long long __sanitizer___kernel_off_t; |
540 | #else |
541 | typedef long __sanitizer___kernel_off_t; |
542 | #endif |
543 | |
544 | #if defined(__powerpc__) || defined(__mips__) |
545 | typedef unsigned int __sanitizer___kernel_old_uid_t; |
546 | typedef unsigned int __sanitizer___kernel_old_gid_t; |
547 | #else |
548 | typedef unsigned short __sanitizer___kernel_old_uid_t; |
549 | typedef unsigned short __sanitizer___kernel_old_gid_t; |
550 | #endif |
551 | |
552 | typedef long long __sanitizer___kernel_loff_t; |
553 | typedef struct { |
554 | unsigned long fds_bits[1024 / (8 * sizeof(long))]; |
555 | } __sanitizer___kernel_fd_set; |
556 | #endif |
557 | |
558 | // This thing depends on the platform. We are only interested in the upper |
559 | // limit. Verified with a compiler assert in .cpp. |
560 | union __sanitizer_pthread_attr_t { |
561 | char size[128]; |
562 | void *align; |
563 | }; |
564 | |
565 | #if SANITIZER_ANDROID |
566 | # if SANITIZER_MIPS |
567 | typedef unsigned long __sanitizer_sigset_t[16 / sizeof(unsigned long)]; |
568 | # else |
569 | typedef unsigned long __sanitizer_sigset_t; |
570 | # endif |
571 | #elif SANITIZER_APPLE |
572 | typedef unsigned __sanitizer_sigset_t; |
573 | #elif SANITIZER_LINUX |
574 | struct __sanitizer_sigset_t { |
575 | // The size is determined by looking at sizeof of real sigset_t on linux. |
576 | uptr val[128 / sizeof(uptr)]; |
577 | }; |
578 | #endif |
579 | |
580 | struct __sanitizer_siginfo_pad { |
581 | #if SANITIZER_X32 |
582 | // x32 siginfo_t is aligned to 8 bytes. |
583 | u64 pad[128 / sizeof(u64)]; |
584 | #else |
585 | // Require uptr, because siginfo_t is always pointer-size aligned on Linux. |
586 | uptr pad[128 / sizeof(uptr)]; |
587 | #endif |
588 | }; |
589 | |
590 | #if SANITIZER_LINUX |
591 | # define SANITIZER_HAS_SIGINFO 1 |
592 | union __sanitizer_siginfo { |
593 | struct { |
594 | int si_signo; |
595 | # if SANITIZER_MIPS |
596 | int si_code; |
597 | int si_errno; |
598 | # else |
599 | int si_errno; |
600 | int si_code; |
601 | # endif |
602 | }; |
603 | __sanitizer_siginfo_pad pad; |
604 | }; |
605 | #else |
606 | # define SANITIZER_HAS_SIGINFO 0 |
607 | typedef __sanitizer_siginfo_pad __sanitizer_siginfo; |
608 | #endif |
609 | |
610 | using __sanitizer_sighandler_ptr = void (*)(int sig); |
611 | using __sanitizer_sigactionhandler_ptr = void (*)(int sig, |
612 | __sanitizer_siginfo *siginfo, |
613 | void *uctx); |
614 | |
615 | // Linux system headers define the 'sa_handler' and 'sa_sigaction' macros. |
616 | #if SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 64) |
617 | struct __sanitizer_sigaction { |
618 | unsigned sa_flags; |
619 | union { |
620 | __sanitizer_sigactionhandler_ptr sigaction; |
621 | __sanitizer_sighandler_ptr handler; |
622 | }; |
623 | __sanitizer_sigset_t sa_mask; |
624 | void (*sa_restorer)(); |
625 | }; |
626 | #elif SANITIZER_ANDROID && SANITIZER_MIPS32 // check this before WORDSIZE == 32 |
627 | struct __sanitizer_sigaction { |
628 | unsigned sa_flags; |
629 | union { |
630 | __sanitizer_sigactionhandler_ptr sigaction; |
631 | __sanitizer_sighandler_ptr handler; |
632 | }; |
633 | __sanitizer_sigset_t sa_mask; |
634 | }; |
635 | #elif SANITIZER_ANDROID && (SANITIZER_WORDSIZE == 32) |
636 | struct __sanitizer_sigaction { |
637 | union { |
638 | __sanitizer_sigactionhandler_ptr sigaction; |
639 | __sanitizer_sighandler_ptr handler; |
640 | }; |
641 | __sanitizer_sigset_t sa_mask; |
642 | uptr sa_flags; |
643 | void (*sa_restorer)(); |
644 | }; |
645 | #else // !SANITIZER_ANDROID |
646 | struct __sanitizer_sigaction { |
647 | #if defined(__mips__) && !SANITIZER_FREEBSD |
648 | unsigned int sa_flags; |
649 | #endif |
650 | union { |
651 | __sanitizer_sigactionhandler_ptr sigaction; |
652 | __sanitizer_sighandler_ptr handler; |
653 | }; |
654 | #if SANITIZER_FREEBSD |
655 | int sa_flags; |
656 | __sanitizer_sigset_t sa_mask; |
657 | #else |
658 | #if defined(__s390x__) |
659 | int sa_resv; |
660 | #else |
661 | __sanitizer_sigset_t sa_mask; |
662 | #endif |
663 | #ifndef __mips__ |
664 | #if defined(__sparc__) |
665 | #if __GLIBC_PREREQ (2, 20) |
666 | // On sparc glibc 2.19 and earlier sa_flags was unsigned long. |
667 | #if defined(__arch64__) |
668 | // To maintain ABI compatibility on sparc64 when switching to an int, |
669 | // __glibc_reserved0 was added. |
670 | int __glibc_reserved0; |
671 | #endif |
672 | int sa_flags; |
673 | #else |
674 | unsigned long sa_flags; |
675 | #endif |
676 | #else |
677 | int sa_flags; |
678 | #endif |
679 | #endif |
680 | #endif |
681 | #if SANITIZER_LINUX |
682 | void (*sa_restorer)(); |
683 | #endif |
684 | #if defined(__mips__) && (SANITIZER_WORDSIZE == 32) |
685 | int sa_resv[1]; |
686 | #endif |
687 | #if defined(__s390x__) |
688 | __sanitizer_sigset_t sa_mask; |
689 | #endif |
690 | }; |
691 | #endif // !SANITIZER_ANDROID |
692 | |
693 | #if defined(__mips__) |
694 | #define __SANITIZER_KERNEL_NSIG 128 |
695 | #else |
696 | #define __SANITIZER_KERNEL_NSIG 64 |
697 | #endif |
698 | |
699 | struct __sanitizer_kernel_sigset_t { |
700 | uptr sig[__SANITIZER_KERNEL_NSIG / (sizeof(uptr) * 8)]; |
701 | }; |
702 | |
703 | // Linux system headers define the 'sa_handler' and 'sa_sigaction' macros. |
704 | #if SANITIZER_MIPS |
705 | struct __sanitizer_kernel_sigaction_t { |
706 | unsigned int sa_flags; |
707 | union { |
708 | void (*handler)(int signo); |
709 | void (*sigaction)(int signo, __sanitizer_siginfo *info, void *ctx); |
710 | }; |
711 | __sanitizer_kernel_sigset_t sa_mask; |
712 | void (*sa_restorer)(void); |
713 | }; |
714 | #else |
715 | struct __sanitizer_kernel_sigaction_t { |
716 | union { |
717 | void (*handler)(int signo); |
718 | void (*sigaction)(int signo, __sanitizer_siginfo *info, void *ctx); |
719 | }; |
720 | unsigned long sa_flags; |
721 | void (*sa_restorer)(void); |
722 | __sanitizer_kernel_sigset_t sa_mask; |
723 | }; |
724 | #endif |
725 | |
726 | extern const uptr sig_ign; |
727 | extern const uptr sig_dfl; |
728 | extern const uptr sig_err; |
729 | extern const uptr sa_siginfo; |
730 | |
731 | #if SANITIZER_LINUX |
732 | extern int e_tabsz; |
733 | #endif |
734 | |
735 | extern int af_inet; |
736 | extern int af_inet6; |
737 | uptr __sanitizer_in_addr_sz(int af); |
738 | |
739 | #if SANITIZER_LINUX |
740 | struct __sanitizer_dl_phdr_info { |
741 | uptr dlpi_addr; |
742 | const char *dlpi_name; |
743 | const void *dlpi_phdr; |
744 | short dlpi_phnum; |
745 | }; |
746 | |
747 | extern unsigned struct_ElfW_Phdr_sz; |
748 | #endif |
749 | |
750 | struct __sanitizer_protoent { |
751 | char *p_name; |
752 | char **p_aliases; |
753 | int p_proto; |
754 | }; |
755 | |
756 | struct __sanitizer_netent { |
757 | char *n_name; |
758 | char **n_aliases; |
759 | int n_addrtype; |
760 | u32 n_net; |
761 | }; |
762 | |
763 | struct __sanitizer_addrinfo { |
764 | int ai_flags; |
765 | int ai_family; |
766 | int ai_socktype; |
767 | int ai_protocol; |
768 | #if SANITIZER_ANDROID || SANITIZER_APPLE |
769 | unsigned ai_addrlen; |
770 | char *ai_canonname; |
771 | void *ai_addr; |
772 | #else // LINUX |
773 | unsigned ai_addrlen; |
774 | void *ai_addr; |
775 | char *ai_canonname; |
776 | #endif |
777 | struct __sanitizer_addrinfo *ai_next; |
778 | }; |
779 | |
780 | struct __sanitizer_hostent { |
781 | char *h_name; |
782 | char **h_aliases; |
783 | int h_addrtype; |
784 | int h_length; |
785 | char **h_addr_list; |
786 | }; |
787 | |
788 | struct __sanitizer_pollfd { |
789 | int fd; |
790 | short events; |
791 | short revents; |
792 | }; |
793 | |
794 | #if SANITIZER_ANDROID || SANITIZER_APPLE |
795 | typedef unsigned __sanitizer_nfds_t; |
796 | #else |
797 | typedef unsigned long __sanitizer_nfds_t; |
798 | #endif |
799 | |
800 | #if !SANITIZER_ANDROID |
801 | # if SANITIZER_LINUX |
802 | struct __sanitizer_glob_t { |
803 | uptr gl_pathc; |
804 | char **gl_pathv; |
805 | uptr gl_offs; |
806 | int gl_flags; |
807 | |
808 | void (*gl_closedir)(void *dirp); |
809 | void *(*gl_readdir)(void *dirp); |
810 | void *(*gl_opendir)(const char *); |
811 | int (*gl_lstat)(const char *, void *); |
812 | int (*gl_stat)(const char *, void *); |
813 | }; |
814 | # endif // SANITIZER_LINUX |
815 | |
816 | # if SANITIZER_LINUX |
817 | extern int glob_nomatch; |
818 | extern int glob_altdirfunc; |
819 | # endif |
820 | #endif // !SANITIZER_ANDROID |
821 | |
822 | extern unsigned path_max; |
823 | |
824 | # if !SANITIZER_ANDROID |
825 | extern const int wordexp_wrde_dooffs; |
826 | # endif // !SANITIZER_ANDROID |
827 | |
828 | struct __sanitizer_wordexp_t { |
829 | uptr we_wordc; |
830 | char **we_wordv; |
831 | uptr we_offs; |
832 | }; |
833 | |
834 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
835 | struct __sanitizer_FILE { |
836 | int _flags; |
837 | char *_IO_read_ptr; |
838 | char *_IO_read_end; |
839 | char *_IO_read_base; |
840 | char *_IO_write_base; |
841 | char *_IO_write_ptr; |
842 | char *_IO_write_end; |
843 | char *_IO_buf_base; |
844 | char *_IO_buf_end; |
845 | char *_IO_save_base; |
846 | char *_IO_backup_base; |
847 | char *_IO_save_end; |
848 | void *_markers; |
849 | __sanitizer_FILE *_chain; |
850 | int _fileno; |
851 | }; |
852 | # define SANITIZER_HAS_STRUCT_FILE 1 |
853 | #else |
854 | typedef void __sanitizer_FILE; |
855 | # define SANITIZER_HAS_STRUCT_FILE 0 |
856 | #endif |
857 | |
858 | #if SANITIZER_LINUX && !SANITIZER_ANDROID && \ |
859 | (defined(__i386) || defined(__x86_64) || defined(__mips64) || \ |
860 | defined(__powerpc64__) || defined(__aarch64__) || defined(__arm__) || \ |
861 | defined(__s390__) || defined(__loongarch__) || SANITIZER_RISCV64) |
862 | extern unsigned struct_user_regs_struct_sz; |
863 | extern unsigned struct_user_fpregs_struct_sz; |
864 | extern unsigned struct_user_fpxregs_struct_sz; |
865 | extern unsigned struct_user_vfpregs_struct_sz; |
866 | |
867 | extern int ptrace_peektext; |
868 | extern int ptrace_peekdata; |
869 | extern int ptrace_peekuser; |
870 | extern int ptrace_getregs; |
871 | extern int ptrace_setregs; |
872 | extern int ptrace_getfpregs; |
873 | extern int ptrace_setfpregs; |
874 | extern int ptrace_getfpxregs; |
875 | extern int ptrace_setfpxregs; |
876 | extern int ptrace_getvfpregs; |
877 | extern int ptrace_setvfpregs; |
878 | extern int ptrace_getsiginfo; |
879 | extern int ptrace_setsiginfo; |
880 | extern int ptrace_getregset; |
881 | extern int ptrace_setregset; |
882 | extern int ptrace_geteventmsg; |
883 | #endif |
884 | |
885 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
886 | extern unsigned struct_shminfo_sz; |
887 | extern unsigned struct_shm_info_sz; |
888 | extern int shmctl_ipc_stat; |
889 | extern int shmctl_ipc_info; |
890 | extern int shmctl_shm_info; |
891 | extern int shmctl_shm_stat; |
892 | #endif |
893 | |
894 | #if !SANITIZER_APPLE && !SANITIZER_FREEBSD |
895 | extern unsigned struct_utmp_sz; |
896 | #endif |
897 | #if !SANITIZER_ANDROID |
898 | extern unsigned struct_utmpx_sz; |
899 | #endif |
900 | |
901 | extern int map_fixed; |
902 | |
903 | // ioctl arguments |
904 | struct __sanitizer_ifconf { |
905 | int ifc_len; |
906 | union { |
907 | void *ifcu_req; |
908 | } ifc_ifcu; |
909 | #if SANITIZER_APPLE |
910 | } __attribute__((packed)); |
911 | #else |
912 | }; |
913 | #endif |
914 | |
915 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
916 | struct __sanitizer__obstack_chunk { |
917 | char *limit; |
918 | struct __sanitizer__obstack_chunk *prev; |
919 | }; |
920 | |
921 | struct __sanitizer_obstack { |
922 | long chunk_size; |
923 | struct __sanitizer__obstack_chunk *chunk; |
924 | char *object_base; |
925 | char *next_free; |
926 | uptr more_fields[7]; |
927 | }; |
928 | |
929 | typedef uptr (*__sanitizer_cookie_io_read)(void *cookie, char *buf, uptr size); |
930 | typedef uptr (*__sanitizer_cookie_io_write)(void *cookie, const char *buf, |
931 | uptr size); |
932 | typedef int (*__sanitizer_cookie_io_seek)(void *cookie, u64 *offset, |
933 | int whence); |
934 | typedef int (*__sanitizer_cookie_io_close)(void *cookie); |
935 | |
936 | struct __sanitizer_cookie_io_functions_t { |
937 | __sanitizer_cookie_io_read read; |
938 | __sanitizer_cookie_io_write write; |
939 | __sanitizer_cookie_io_seek seek; |
940 | __sanitizer_cookie_io_close close; |
941 | }; |
942 | #endif |
943 | |
944 | #define IOC_NRBITS 8 |
945 | #define IOC_TYPEBITS 8 |
946 | #if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) || \ |
947 | defined(__sparc__) |
948 | #define IOC_SIZEBITS 13 |
949 | #define IOC_DIRBITS 3 |
950 | #define IOC_NONE 1U |
951 | #define IOC_WRITE 4U |
952 | #define IOC_READ 2U |
953 | #else |
954 | #define IOC_SIZEBITS 14 |
955 | #define IOC_DIRBITS 2 |
956 | #define IOC_NONE 0U |
957 | #define IOC_WRITE 1U |
958 | #define IOC_READ 2U |
959 | #endif |
960 | #define IOC_NRMASK ((1 << IOC_NRBITS) - 1) |
961 | #define IOC_TYPEMASK ((1 << IOC_TYPEBITS) - 1) |
962 | #define IOC_SIZEMASK ((1 << IOC_SIZEBITS) - 1) |
963 | #if defined(IOC_DIRMASK) |
964 | #undef IOC_DIRMASK |
965 | #endif |
966 | #define IOC_DIRMASK ((1 << IOC_DIRBITS) - 1) |
967 | #define IOC_NRSHIFT 0 |
968 | #define IOC_TYPESHIFT (IOC_NRSHIFT + IOC_NRBITS) |
969 | #define IOC_SIZESHIFT (IOC_TYPESHIFT + IOC_TYPEBITS) |
970 | #define IOC_DIRSHIFT (IOC_SIZESHIFT + IOC_SIZEBITS) |
971 | #define EVIOC_EV_MAX 0x1f |
972 | #define EVIOC_ABS_MAX 0x3f |
973 | |
974 | #define IOC_DIR(nr) (((nr) >> IOC_DIRSHIFT) & IOC_DIRMASK) |
975 | #define IOC_TYPE(nr) (((nr) >> IOC_TYPESHIFT) & IOC_TYPEMASK) |
976 | #define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK) |
977 | |
978 | #if defined(__sparc__) |
979 | // In sparc the 14 bits SIZE field overlaps with the |
980 | // least significant bit of DIR, so either IOC_READ or |
981 | // IOC_WRITE shall be 1 in order to get a non-zero SIZE. |
982 | #define IOC_SIZE(nr) \ |
983 | ((((((nr) >> 29) & 0x7) & (4U | 2U)) == 0) ? 0 : (((nr) >> 16) & 0x3fff)) |
984 | #else |
985 | #define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK) |
986 | #endif |
987 | |
988 | extern unsigned struct_ifreq_sz; |
989 | extern unsigned struct_termios_sz; |
990 | extern unsigned struct_winsize_sz; |
991 | |
992 | #if SANITIZER_LINUX |
993 | extern unsigned struct_arpreq_sz; |
994 | extern unsigned struct_cdrom_msf_sz; |
995 | extern unsigned struct_cdrom_multisession_sz; |
996 | extern unsigned struct_cdrom_read_audio_sz; |
997 | extern unsigned struct_cdrom_subchnl_sz; |
998 | extern unsigned struct_cdrom_ti_sz; |
999 | extern unsigned struct_cdrom_tocentry_sz; |
1000 | extern unsigned struct_cdrom_tochdr_sz; |
1001 | extern unsigned struct_cdrom_volctrl_sz; |
1002 | extern unsigned struct_ff_effect_sz; |
1003 | extern unsigned struct_floppy_drive_params_sz; |
1004 | extern unsigned struct_floppy_drive_struct_sz; |
1005 | extern unsigned struct_floppy_fdc_state_sz; |
1006 | extern unsigned struct_floppy_max_errors_sz; |
1007 | extern unsigned struct_floppy_raw_cmd_sz; |
1008 | extern unsigned struct_floppy_struct_sz; |
1009 | extern unsigned struct_floppy_write_errors_sz; |
1010 | extern unsigned struct_format_descr_sz; |
1011 | extern unsigned struct_hd_driveid_sz; |
1012 | extern unsigned struct_hd_geometry_sz; |
1013 | extern unsigned struct_input_absinfo_sz; |
1014 | extern unsigned struct_input_id_sz; |
1015 | extern unsigned struct_mtpos_sz; |
1016 | extern unsigned struct_termio_sz; |
1017 | extern unsigned struct_vt_consize_sz; |
1018 | extern unsigned struct_vt_sizes_sz; |
1019 | extern unsigned struct_vt_stat_sz; |
1020 | #endif // SANITIZER_LINUX |
1021 | |
1022 | #if SANITIZER_LINUX |
1023 | extern unsigned struct_copr_buffer_sz; |
1024 | extern unsigned struct_copr_debug_buf_sz; |
1025 | extern unsigned struct_copr_msg_sz; |
1026 | extern unsigned struct_midi_info_sz; |
1027 | extern unsigned struct_mtget_sz; |
1028 | extern unsigned struct_mtop_sz; |
1029 | extern unsigned struct_rtentry_sz; |
1030 | extern unsigned struct_sbi_instrument_sz; |
1031 | extern unsigned struct_seq_event_rec_sz; |
1032 | extern unsigned struct_synth_info_sz; |
1033 | extern unsigned struct_vt_mode_sz; |
1034 | #endif // SANITIZER_LINUX |
1035 | |
1036 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
1037 | extern unsigned struct_ax25_parms_struct_sz; |
1038 | extern unsigned struct_input_keymap_entry_sz; |
1039 | extern unsigned struct_ipx_config_data_sz; |
1040 | extern unsigned struct_kbdiacrs_sz; |
1041 | extern unsigned struct_kbentry_sz; |
1042 | extern unsigned struct_kbkeycode_sz; |
1043 | extern unsigned struct_kbsentry_sz; |
1044 | extern unsigned struct_mtconfiginfo_sz; |
1045 | extern unsigned struct_nr_parms_struct_sz; |
1046 | extern unsigned struct_scc_modem_sz; |
1047 | extern unsigned struct_scc_stat_sz; |
1048 | extern unsigned struct_serial_multiport_struct_sz; |
1049 | extern unsigned struct_serial_struct_sz; |
1050 | extern unsigned struct_sockaddr_ax25_sz; |
1051 | extern unsigned struct_unimapdesc_sz; |
1052 | extern unsigned struct_unimapinit_sz; |
1053 | #endif // SANITIZER_LINUX && !SANITIZER_ANDROID |
1054 | |
1055 | extern const unsigned long __sanitizer_bufsiz; |
1056 | |
1057 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
1058 | extern unsigned struct_audio_buf_info_sz; |
1059 | extern unsigned struct_ppp_stats_sz; |
1060 | #endif // (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID |
1061 | |
1062 | #if !SANITIZER_ANDROID && !SANITIZER_APPLE |
1063 | extern unsigned struct_sioc_sg_req_sz; |
1064 | extern unsigned struct_sioc_vif_req_sz; |
1065 | #endif |
1066 | |
1067 | // ioctl request identifiers |
1068 | |
1069 | // A special value to mark ioctls that are not present on the target platform, |
1070 | // when it can not be determined without including any system headers. |
1071 | extern const unsigned IOCTL_NOT_PRESENT; |
1072 | |
1073 | extern unsigned IOCTL_FIOASYNC; |
1074 | extern unsigned IOCTL_FIOCLEX; |
1075 | extern unsigned IOCTL_FIOGETOWN; |
1076 | extern unsigned IOCTL_FIONBIO; |
1077 | extern unsigned IOCTL_FIONCLEX; |
1078 | extern unsigned IOCTL_FIOSETOWN; |
1079 | extern unsigned IOCTL_SIOCADDMULTI; |
1080 | extern unsigned IOCTL_SIOCATMARK; |
1081 | extern unsigned IOCTL_SIOCDELMULTI; |
1082 | extern unsigned IOCTL_SIOCGIFADDR; |
1083 | extern unsigned IOCTL_SIOCGIFBRDADDR; |
1084 | extern unsigned IOCTL_SIOCGIFCONF; |
1085 | extern unsigned IOCTL_SIOCGIFDSTADDR; |
1086 | extern unsigned IOCTL_SIOCGIFFLAGS; |
1087 | extern unsigned IOCTL_SIOCGIFMETRIC; |
1088 | extern unsigned IOCTL_SIOCGIFMTU; |
1089 | extern unsigned IOCTL_SIOCGIFNETMASK; |
1090 | extern unsigned IOCTL_SIOCGPGRP; |
1091 | extern unsigned IOCTL_SIOCSIFADDR; |
1092 | extern unsigned IOCTL_SIOCSIFBRDADDR; |
1093 | extern unsigned IOCTL_SIOCSIFDSTADDR; |
1094 | extern unsigned IOCTL_SIOCSIFFLAGS; |
1095 | extern unsigned IOCTL_SIOCSIFMETRIC; |
1096 | extern unsigned IOCTL_SIOCSIFMTU; |
1097 | extern unsigned IOCTL_SIOCSIFNETMASK; |
1098 | extern unsigned IOCTL_SIOCSPGRP; |
1099 | extern unsigned IOCTL_TIOCCONS; |
1100 | extern unsigned IOCTL_TIOCEXCL; |
1101 | extern unsigned IOCTL_TIOCGETD; |
1102 | extern unsigned IOCTL_TIOCGPGRP; |
1103 | extern unsigned IOCTL_TIOCGWINSZ; |
1104 | extern unsigned IOCTL_TIOCMBIC; |
1105 | extern unsigned IOCTL_TIOCMBIS; |
1106 | extern unsigned IOCTL_TIOCMGET; |
1107 | extern unsigned IOCTL_TIOCMSET; |
1108 | extern unsigned IOCTL_TIOCNOTTY; |
1109 | extern unsigned IOCTL_TIOCNXCL; |
1110 | extern unsigned IOCTL_TIOCOUTQ; |
1111 | extern unsigned IOCTL_TIOCPKT; |
1112 | extern unsigned IOCTL_TIOCSCTTY; |
1113 | extern unsigned IOCTL_TIOCSETD; |
1114 | extern unsigned IOCTL_TIOCSPGRP; |
1115 | extern unsigned IOCTL_TIOCSTI; |
1116 | extern unsigned IOCTL_TIOCSWINSZ; |
1117 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
1118 | extern unsigned IOCTL_SIOCGETSGCNT; |
1119 | extern unsigned IOCTL_SIOCGETVIFCNT; |
1120 | #endif |
1121 | #if SANITIZER_LINUX |
1122 | extern unsigned IOCTL_EVIOCGABS; |
1123 | extern unsigned IOCTL_EVIOCGBIT; |
1124 | extern unsigned IOCTL_EVIOCGEFFECTS; |
1125 | extern unsigned IOCTL_EVIOCGID; |
1126 | extern unsigned IOCTL_EVIOCGKEY; |
1127 | extern unsigned IOCTL_EVIOCGKEYCODE; |
1128 | extern unsigned IOCTL_EVIOCGLED; |
1129 | extern unsigned IOCTL_EVIOCGNAME; |
1130 | extern unsigned IOCTL_EVIOCGPHYS; |
1131 | extern unsigned IOCTL_EVIOCGRAB; |
1132 | extern unsigned IOCTL_EVIOCGREP; |
1133 | extern unsigned IOCTL_EVIOCGSND; |
1134 | extern unsigned IOCTL_EVIOCGSW; |
1135 | extern unsigned IOCTL_EVIOCGUNIQ; |
1136 | extern unsigned IOCTL_EVIOCGVERSION; |
1137 | extern unsigned IOCTL_EVIOCRMFF; |
1138 | extern unsigned IOCTL_EVIOCSABS; |
1139 | extern unsigned IOCTL_EVIOCSFF; |
1140 | extern unsigned IOCTL_EVIOCSKEYCODE; |
1141 | extern unsigned IOCTL_EVIOCSREP; |
1142 | extern unsigned IOCTL_BLKFLSBUF; |
1143 | extern unsigned IOCTL_BLKGETSIZE; |
1144 | extern unsigned IOCTL_BLKRAGET; |
1145 | extern unsigned IOCTL_BLKRASET; |
1146 | extern unsigned IOCTL_BLKROGET; |
1147 | extern unsigned IOCTL_BLKROSET; |
1148 | extern unsigned IOCTL_BLKRRPART; |
1149 | extern unsigned IOCTL_BLKFRASET; |
1150 | extern unsigned IOCTL_BLKFRAGET; |
1151 | extern unsigned IOCTL_BLKSECTSET; |
1152 | extern unsigned IOCTL_BLKSECTGET; |
1153 | extern unsigned IOCTL_BLKSSZGET; |
1154 | extern unsigned IOCTL_BLKBSZGET; |
1155 | extern unsigned IOCTL_BLKBSZSET; |
1156 | extern unsigned IOCTL_BLKGETSIZE64; |
1157 | extern unsigned IOCTL_CDROMAUDIOBUFSIZ; |
1158 | extern unsigned IOCTL_CDROMEJECT; |
1159 | extern unsigned IOCTL_CDROMEJECT_SW; |
1160 | extern unsigned IOCTL_CDROMMULTISESSION; |
1161 | extern unsigned IOCTL_CDROMPAUSE; |
1162 | extern unsigned IOCTL_CDROMPLAYMSF; |
1163 | extern unsigned IOCTL_CDROMPLAYTRKIND; |
1164 | extern unsigned IOCTL_CDROMREADAUDIO; |
1165 | extern unsigned IOCTL_CDROMREADCOOKED; |
1166 | extern unsigned IOCTL_CDROMREADMODE1; |
1167 | extern unsigned IOCTL_CDROMREADMODE2; |
1168 | extern unsigned IOCTL_CDROMREADRAW; |
1169 | extern unsigned IOCTL_CDROMREADTOCENTRY; |
1170 | extern unsigned IOCTL_CDROMREADTOCHDR; |
1171 | extern unsigned IOCTL_CDROMRESET; |
1172 | extern unsigned IOCTL_CDROMRESUME; |
1173 | extern unsigned IOCTL_CDROMSEEK; |
1174 | extern unsigned IOCTL_CDROMSTART; |
1175 | extern unsigned IOCTL_CDROMSTOP; |
1176 | extern unsigned IOCTL_CDROMSUBCHNL; |
1177 | extern unsigned IOCTL_CDROMVOLCTRL; |
1178 | extern unsigned IOCTL_CDROMVOLREAD; |
1179 | extern unsigned IOCTL_CDROM_GET_UPC; |
1180 | extern unsigned IOCTL_FDCLRPRM; |
1181 | extern unsigned IOCTL_FDDEFPRM; |
1182 | extern unsigned IOCTL_FDFLUSH; |
1183 | extern unsigned IOCTL_FDFMTBEG; |
1184 | extern unsigned IOCTL_FDFMTEND; |
1185 | extern unsigned IOCTL_FDFMTTRK; |
1186 | extern unsigned IOCTL_FDGETDRVPRM; |
1187 | extern unsigned IOCTL_FDGETDRVSTAT; |
1188 | extern unsigned IOCTL_FDGETDRVTYP; |
1189 | extern unsigned IOCTL_FDGETFDCSTAT; |
1190 | extern unsigned IOCTL_FDGETMAXERRS; |
1191 | extern unsigned IOCTL_FDGETPRM; |
1192 | extern unsigned IOCTL_FDMSGOFF; |
1193 | extern unsigned IOCTL_FDMSGON; |
1194 | extern unsigned IOCTL_FDPOLLDRVSTAT; |
1195 | extern unsigned IOCTL_FDRAWCMD; |
1196 | extern unsigned IOCTL_FDRESET; |
1197 | extern unsigned IOCTL_FDSETDRVPRM; |
1198 | extern unsigned IOCTL_FDSETEMSGTRESH; |
1199 | extern unsigned IOCTL_FDSETMAXERRS; |
1200 | extern unsigned IOCTL_FDSETPRM; |
1201 | extern unsigned IOCTL_FDTWADDLE; |
1202 | extern unsigned IOCTL_FDWERRORCLR; |
1203 | extern unsigned IOCTL_FDWERRORGET; |
1204 | extern unsigned IOCTL_HDIO_DRIVE_CMD; |
1205 | extern unsigned IOCTL_HDIO_GETGEO; |
1206 | extern unsigned IOCTL_HDIO_GET_32BIT; |
1207 | extern unsigned IOCTL_HDIO_GET_DMA; |
1208 | extern unsigned IOCTL_HDIO_GET_IDENTITY; |
1209 | extern unsigned IOCTL_HDIO_GET_KEEPSETTINGS; |
1210 | extern unsigned IOCTL_HDIO_GET_MULTCOUNT; |
1211 | extern unsigned IOCTL_HDIO_GET_NOWERR; |
1212 | extern unsigned IOCTL_HDIO_GET_UNMASKINTR; |
1213 | extern unsigned IOCTL_HDIO_SET_32BIT; |
1214 | extern unsigned IOCTL_HDIO_SET_DMA; |
1215 | extern unsigned IOCTL_HDIO_SET_KEEPSETTINGS; |
1216 | extern unsigned IOCTL_HDIO_SET_MULTCOUNT; |
1217 | extern unsigned IOCTL_HDIO_SET_NOWERR; |
1218 | extern unsigned IOCTL_HDIO_SET_UNMASKINTR; |
1219 | extern unsigned IOCTL_MTIOCPOS; |
1220 | extern unsigned IOCTL_PPPIOCGASYNCMAP; |
1221 | extern unsigned IOCTL_PPPIOCGDEBUG; |
1222 | extern unsigned IOCTL_PPPIOCGFLAGS; |
1223 | extern unsigned IOCTL_PPPIOCGUNIT; |
1224 | extern unsigned IOCTL_PPPIOCGXASYNCMAP; |
1225 | extern unsigned IOCTL_PPPIOCSASYNCMAP; |
1226 | extern unsigned IOCTL_PPPIOCSDEBUG; |
1227 | extern unsigned IOCTL_PPPIOCSFLAGS; |
1228 | extern unsigned IOCTL_PPPIOCSMAXCID; |
1229 | extern unsigned IOCTL_PPPIOCSMRU; |
1230 | extern unsigned IOCTL_PPPIOCSXASYNCMAP; |
1231 | extern unsigned IOCTL_SIOCDARP; |
1232 | extern unsigned IOCTL_SIOCDRARP; |
1233 | extern unsigned IOCTL_SIOCGARP; |
1234 | extern unsigned IOCTL_SIOCGIFENCAP; |
1235 | extern unsigned IOCTL_SIOCGIFHWADDR; |
1236 | extern unsigned IOCTL_SIOCGIFMAP; |
1237 | extern unsigned IOCTL_SIOCGIFMEM; |
1238 | extern unsigned IOCTL_SIOCGIFNAME; |
1239 | extern unsigned IOCTL_SIOCGIFSLAVE; |
1240 | extern unsigned IOCTL_SIOCGRARP; |
1241 | extern unsigned IOCTL_SIOCGSTAMP; |
1242 | extern unsigned IOCTL_SIOCSARP; |
1243 | extern unsigned IOCTL_SIOCSIFENCAP; |
1244 | extern unsigned IOCTL_SIOCSIFHWADDR; |
1245 | extern unsigned IOCTL_SIOCSIFLINK; |
1246 | extern unsigned IOCTL_SIOCSIFMAP; |
1247 | extern unsigned IOCTL_SIOCSIFMEM; |
1248 | extern unsigned IOCTL_SIOCSIFSLAVE; |
1249 | extern unsigned IOCTL_SIOCSRARP; |
1250 | extern unsigned IOCTL_SNDCTL_COPR_HALT; |
1251 | extern unsigned IOCTL_SNDCTL_COPR_LOAD; |
1252 | extern unsigned IOCTL_SNDCTL_COPR_RCODE; |
1253 | extern unsigned IOCTL_SNDCTL_COPR_RCVMSG; |
1254 | extern unsigned IOCTL_SNDCTL_COPR_RDATA; |
1255 | extern unsigned IOCTL_SNDCTL_COPR_RESET; |
1256 | extern unsigned IOCTL_SNDCTL_COPR_RUN; |
1257 | extern unsigned IOCTL_SNDCTL_COPR_SENDMSG; |
1258 | extern unsigned IOCTL_SNDCTL_COPR_WCODE; |
1259 | extern unsigned IOCTL_SNDCTL_COPR_WDATA; |
1260 | extern unsigned IOCTL_TCFLSH; |
1261 | extern unsigned IOCTL_TCGETA; |
1262 | extern unsigned IOCTL_TCGETS; |
1263 | extern unsigned IOCTL_TCSBRK; |
1264 | extern unsigned IOCTL_TCSBRKP; |
1265 | extern unsigned IOCTL_TCSETA; |
1266 | extern unsigned IOCTL_TCSETAF; |
1267 | extern unsigned IOCTL_TCSETAW; |
1268 | extern unsigned IOCTL_TCSETS; |
1269 | extern unsigned IOCTL_TCSETSF; |
1270 | extern unsigned IOCTL_TCSETSW; |
1271 | extern unsigned IOCTL_TCXONC; |
1272 | extern unsigned IOCTL_TIOCGLCKTRMIOS; |
1273 | extern unsigned IOCTL_TIOCGSOFTCAR; |
1274 | extern unsigned IOCTL_TIOCINQ; |
1275 | extern unsigned IOCTL_TIOCLINUX; |
1276 | extern unsigned IOCTL_TIOCSERCONFIG; |
1277 | extern unsigned IOCTL_TIOCSERGETLSR; |
1278 | extern unsigned IOCTL_TIOCSERGWILD; |
1279 | extern unsigned IOCTL_TIOCSERSWILD; |
1280 | extern unsigned IOCTL_TIOCSLCKTRMIOS; |
1281 | extern unsigned IOCTL_TIOCSSOFTCAR; |
1282 | extern unsigned IOCTL_VT_DISALLOCATE; |
1283 | extern unsigned IOCTL_VT_GETSTATE; |
1284 | extern unsigned IOCTL_VT_RESIZE; |
1285 | extern unsigned IOCTL_VT_RESIZEX; |
1286 | extern unsigned IOCTL_VT_SENDSIG; |
1287 | extern unsigned IOCTL_MTIOCGET; |
1288 | extern unsigned IOCTL_MTIOCTOP; |
1289 | extern unsigned IOCTL_SIOCADDRT; |
1290 | extern unsigned IOCTL_SIOCDELRT; |
1291 | extern unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE; |
1292 | extern unsigned IOCTL_SNDCTL_DSP_GETFMTS; |
1293 | extern unsigned IOCTL_SNDCTL_DSP_NONBLOCK; |
1294 | extern unsigned IOCTL_SNDCTL_DSP_POST; |
1295 | extern unsigned IOCTL_SNDCTL_DSP_RESET; |
1296 | extern unsigned IOCTL_SNDCTL_DSP_SETFMT; |
1297 | extern unsigned IOCTL_SNDCTL_DSP_SETFRAGMENT; |
1298 | extern unsigned IOCTL_SNDCTL_DSP_SPEED; |
1299 | extern unsigned IOCTL_SNDCTL_DSP_STEREO; |
1300 | extern unsigned IOCTL_SNDCTL_DSP_SUBDIVIDE; |
1301 | extern unsigned IOCTL_SNDCTL_DSP_SYNC; |
1302 | extern unsigned IOCTL_SNDCTL_FM_4OP_ENABLE; |
1303 | extern unsigned IOCTL_SNDCTL_FM_LOAD_INSTR; |
1304 | extern unsigned IOCTL_SNDCTL_MIDI_INFO; |
1305 | extern unsigned IOCTL_SNDCTL_MIDI_PRETIME; |
1306 | extern unsigned IOCTL_SNDCTL_SEQ_CTRLRATE; |
1307 | extern unsigned IOCTL_SNDCTL_SEQ_GETINCOUNT; |
1308 | extern unsigned IOCTL_SNDCTL_SEQ_GETOUTCOUNT; |
1309 | extern unsigned IOCTL_SNDCTL_SEQ_NRMIDIS; |
1310 | extern unsigned IOCTL_SNDCTL_SEQ_NRSYNTHS; |
1311 | extern unsigned IOCTL_SNDCTL_SEQ_OUTOFBAND; |
1312 | extern unsigned IOCTL_SNDCTL_SEQ_PANIC; |
1313 | extern unsigned IOCTL_SNDCTL_SEQ_PERCMODE; |
1314 | extern unsigned IOCTL_SNDCTL_SEQ_RESET; |
1315 | extern unsigned IOCTL_SNDCTL_SEQ_RESETSAMPLES; |
1316 | extern unsigned IOCTL_SNDCTL_SEQ_SYNC; |
1317 | extern unsigned IOCTL_SNDCTL_SEQ_TESTMIDI; |
1318 | extern unsigned IOCTL_SNDCTL_SEQ_THRESHOLD; |
1319 | extern unsigned IOCTL_SNDCTL_SYNTH_INFO; |
1320 | extern unsigned IOCTL_SNDCTL_SYNTH_MEMAVL; |
1321 | extern unsigned IOCTL_SNDCTL_TMR_CONTINUE; |
1322 | extern unsigned IOCTL_SNDCTL_TMR_METRONOME; |
1323 | extern unsigned IOCTL_SNDCTL_TMR_SELECT; |
1324 | extern unsigned IOCTL_SNDCTL_TMR_SOURCE; |
1325 | extern unsigned IOCTL_SNDCTL_TMR_START; |
1326 | extern unsigned IOCTL_SNDCTL_TMR_STOP; |
1327 | extern unsigned IOCTL_SNDCTL_TMR_TEMPO; |
1328 | extern unsigned IOCTL_SNDCTL_TMR_TIMEBASE; |
1329 | extern unsigned IOCTL_SOUND_MIXER_READ_ALTPCM; |
1330 | extern unsigned IOCTL_SOUND_MIXER_READ_BASS; |
1331 | extern unsigned IOCTL_SOUND_MIXER_READ_CAPS; |
1332 | extern unsigned IOCTL_SOUND_MIXER_READ_CD; |
1333 | extern unsigned IOCTL_SOUND_MIXER_READ_DEVMASK; |
1334 | extern unsigned IOCTL_SOUND_MIXER_READ_ENHANCE; |
1335 | extern unsigned IOCTL_SOUND_MIXER_READ_IGAIN; |
1336 | extern unsigned IOCTL_SOUND_MIXER_READ_IMIX; |
1337 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE1; |
1338 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE2; |
1339 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE3; |
1340 | extern unsigned IOCTL_SOUND_MIXER_READ_LINE; |
1341 | extern unsigned IOCTL_SOUND_MIXER_READ_LOUD; |
1342 | extern unsigned IOCTL_SOUND_MIXER_READ_MIC; |
1343 | extern unsigned IOCTL_SOUND_MIXER_READ_MUTE; |
1344 | extern unsigned IOCTL_SOUND_MIXER_READ_OGAIN; |
1345 | extern unsigned IOCTL_SOUND_MIXER_READ_PCM; |
1346 | extern unsigned IOCTL_SOUND_MIXER_READ_RECLEV; |
1347 | extern unsigned IOCTL_SOUND_MIXER_READ_RECMASK; |
1348 | extern unsigned IOCTL_SOUND_MIXER_READ_RECSRC; |
1349 | extern unsigned IOCTL_SOUND_MIXER_READ_SPEAKER; |
1350 | extern unsigned IOCTL_SOUND_MIXER_READ_STEREODEVS; |
1351 | extern unsigned IOCTL_SOUND_MIXER_READ_SYNTH; |
1352 | extern unsigned IOCTL_SOUND_MIXER_READ_TREBLE; |
1353 | extern unsigned IOCTL_SOUND_MIXER_READ_VOLUME; |
1354 | extern unsigned IOCTL_SOUND_MIXER_WRITE_ALTPCM; |
1355 | extern unsigned IOCTL_SOUND_MIXER_WRITE_BASS; |
1356 | extern unsigned IOCTL_SOUND_MIXER_WRITE_CD; |
1357 | extern unsigned IOCTL_SOUND_MIXER_WRITE_ENHANCE; |
1358 | extern unsigned IOCTL_SOUND_MIXER_WRITE_IGAIN; |
1359 | extern unsigned IOCTL_SOUND_MIXER_WRITE_IMIX; |
1360 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE1; |
1361 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE2; |
1362 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE3; |
1363 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LINE; |
1364 | extern unsigned IOCTL_SOUND_MIXER_WRITE_LOUD; |
1365 | extern unsigned IOCTL_SOUND_MIXER_WRITE_MIC; |
1366 | extern unsigned IOCTL_SOUND_MIXER_WRITE_MUTE; |
1367 | extern unsigned IOCTL_SOUND_MIXER_WRITE_OGAIN; |
1368 | extern unsigned IOCTL_SOUND_MIXER_WRITE_PCM; |
1369 | extern unsigned IOCTL_SOUND_MIXER_WRITE_RECLEV; |
1370 | extern unsigned IOCTL_SOUND_MIXER_WRITE_RECSRC; |
1371 | extern unsigned IOCTL_SOUND_MIXER_WRITE_SPEAKER; |
1372 | extern unsigned IOCTL_SOUND_MIXER_WRITE_SYNTH; |
1373 | extern unsigned IOCTL_SOUND_MIXER_WRITE_TREBLE; |
1374 | extern unsigned IOCTL_SOUND_MIXER_WRITE_VOLUME; |
1375 | extern unsigned IOCTL_SOUND_PCM_READ_BITS; |
1376 | extern unsigned IOCTL_SOUND_PCM_READ_CHANNELS; |
1377 | extern unsigned IOCTL_SOUND_PCM_READ_FILTER; |
1378 | extern unsigned IOCTL_SOUND_PCM_READ_RATE; |
1379 | extern unsigned IOCTL_SOUND_PCM_WRITE_CHANNELS; |
1380 | extern unsigned IOCTL_SOUND_PCM_WRITE_FILTER; |
1381 | extern unsigned IOCTL_VT_ACTIVATE; |
1382 | extern unsigned IOCTL_VT_GETMODE; |
1383 | extern unsigned IOCTL_VT_OPENQRY; |
1384 | extern unsigned IOCTL_VT_RELDISP; |
1385 | extern unsigned IOCTL_VT_SETMODE; |
1386 | extern unsigned IOCTL_VT_WAITACTIVE; |
1387 | #endif // SANITIZER_LINUX |
1388 | |
1389 | #if SANITIZER_LINUX && !SANITIZER_ANDROID |
1390 | extern unsigned IOCTL_EQL_EMANCIPATE; |
1391 | extern unsigned IOCTL_EQL_ENSLAVE; |
1392 | extern unsigned IOCTL_EQL_GETMASTRCFG; |
1393 | extern unsigned IOCTL_EQL_GETSLAVECFG; |
1394 | extern unsigned IOCTL_EQL_SETMASTRCFG; |
1395 | extern unsigned IOCTL_EQL_SETSLAVECFG; |
1396 | extern unsigned IOCTL_EVIOCGKEYCODE_V2; |
1397 | extern unsigned IOCTL_EVIOCGPROP; |
1398 | extern unsigned IOCTL_EVIOCSKEYCODE_V2; |
1399 | extern unsigned IOCTL_FS_IOC_GETFLAGS; |
1400 | extern unsigned IOCTL_FS_IOC_GETVERSION; |
1401 | extern unsigned IOCTL_FS_IOC_SETFLAGS; |
1402 | extern unsigned IOCTL_FS_IOC_SETVERSION; |
1403 | extern unsigned IOCTL_GIO_CMAP; |
1404 | extern unsigned IOCTL_GIO_FONT; |
1405 | extern unsigned IOCTL_GIO_UNIMAP; |
1406 | extern unsigned IOCTL_GIO_UNISCRNMAP; |
1407 | extern unsigned IOCTL_KDADDIO; |
1408 | extern unsigned IOCTL_KDDELIO; |
1409 | extern unsigned IOCTL_KDGETKEYCODE; |
1410 | extern unsigned IOCTL_KDGKBDIACR; |
1411 | extern unsigned IOCTL_KDGKBENT; |
1412 | extern unsigned IOCTL_KDGKBLED; |
1413 | extern unsigned IOCTL_KDGKBMETA; |
1414 | extern unsigned IOCTL_KDGKBSENT; |
1415 | extern unsigned IOCTL_KDMAPDISP; |
1416 | extern unsigned IOCTL_KDSETKEYCODE; |
1417 | extern unsigned IOCTL_KDSIGACCEPT; |
1418 | extern unsigned IOCTL_KDSKBDIACR; |
1419 | extern unsigned IOCTL_KDSKBENT; |
1420 | extern unsigned IOCTL_KDSKBLED; |
1421 | extern unsigned IOCTL_KDSKBMETA; |
1422 | extern unsigned IOCTL_KDSKBSENT; |
1423 | extern unsigned IOCTL_KDUNMAPDISP; |
1424 | extern unsigned IOCTL_LPABORT; |
1425 | extern unsigned IOCTL_LPABORTOPEN; |
1426 | extern unsigned IOCTL_LPCAREFUL; |
1427 | extern unsigned IOCTL_LPCHAR; |
1428 | extern unsigned IOCTL_LPGETIRQ; |
1429 | extern unsigned IOCTL_LPGETSTATUS; |
1430 | extern unsigned IOCTL_LPRESET; |
1431 | extern unsigned IOCTL_LPSETIRQ; |
1432 | extern unsigned IOCTL_LPTIME; |
1433 | extern unsigned IOCTL_LPWAIT; |
1434 | extern unsigned IOCTL_MTIOCGETCONFIG; |
1435 | extern unsigned IOCTL_MTIOCSETCONFIG; |
1436 | extern unsigned IOCTL_PIO_CMAP; |
1437 | extern unsigned IOCTL_PIO_FONT; |
1438 | extern unsigned IOCTL_PIO_UNIMAP; |
1439 | extern unsigned IOCTL_PIO_UNIMAPCLR; |
1440 | extern unsigned IOCTL_PIO_UNISCRNMAP; |
1441 | extern unsigned IOCTL_SCSI_IOCTL_GET_IDLUN; |
1442 | extern unsigned IOCTL_SCSI_IOCTL_PROBE_HOST; |
1443 | extern unsigned IOCTL_SCSI_IOCTL_TAGGED_DISABLE; |
1444 | extern unsigned IOCTL_SCSI_IOCTL_TAGGED_ENABLE; |
1445 | extern unsigned IOCTL_SIOCAIPXITFCRT; |
1446 | extern unsigned IOCTL_SIOCAIPXPRISLT; |
1447 | extern unsigned IOCTL_SIOCAX25ADDUID; |
1448 | extern unsigned IOCTL_SIOCAX25DELUID; |
1449 | extern unsigned IOCTL_SIOCAX25GETPARMS; |
1450 | extern unsigned IOCTL_SIOCAX25GETUID; |
1451 | extern unsigned IOCTL_SIOCAX25NOUID; |
1452 | extern unsigned IOCTL_SIOCAX25SETPARMS; |
1453 | extern unsigned IOCTL_SIOCDEVPLIP; |
1454 | extern unsigned IOCTL_SIOCIPXCFGDATA; |
1455 | extern unsigned IOCTL_SIOCNRDECOBS; |
1456 | extern unsigned IOCTL_SIOCNRGETPARMS; |
1457 | extern unsigned IOCTL_SIOCNRRTCTL; |
1458 | extern unsigned IOCTL_SIOCNRSETPARMS; |
1459 | extern unsigned IOCTL_SNDCTL_DSP_GETISPACE; |
1460 | extern unsigned IOCTL_SNDCTL_DSP_GETOSPACE; |
1461 | extern unsigned IOCTL_TIOCGSERIAL; |
1462 | extern unsigned IOCTL_TIOCSERGETMULTI; |
1463 | extern unsigned IOCTL_TIOCSERSETMULTI; |
1464 | extern unsigned IOCTL_TIOCSSERIAL; |
1465 | extern unsigned IOCTL_GIO_SCRNMAP; |
1466 | extern unsigned IOCTL_KDDISABIO; |
1467 | extern unsigned IOCTL_KDENABIO; |
1468 | extern unsigned IOCTL_KDGETLED; |
1469 | extern unsigned IOCTL_KDGETMODE; |
1470 | extern unsigned IOCTL_KDGKBMODE; |
1471 | extern unsigned IOCTL_KDGKBTYPE; |
1472 | extern unsigned IOCTL_KDMKTONE; |
1473 | extern unsigned IOCTL_KDSETLED; |
1474 | extern unsigned IOCTL_KDSETMODE; |
1475 | extern unsigned IOCTL_KDSKBMODE; |
1476 | extern unsigned IOCTL_KIOCSOUND; |
1477 | extern unsigned IOCTL_PIO_SCRNMAP; |
1478 | #endif |
1479 | |
1480 | extern const int si_SEGV_MAPERR; |
1481 | extern const int si_SEGV_ACCERR; |
1482 | } // namespace __sanitizer |
1483 | |
1484 | #define CHECK_TYPE_SIZE(TYPE) \ |
1485 | COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE)) |
1486 | |
1487 | #define CHECK_SIZE_AND_OFFSET(CLASS, MEMBER) \ |
1488 | COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \ |
1489 | sizeof(((CLASS *)NULL)->MEMBER)); \ |
1490 | COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) == \ |
1491 | offsetof(CLASS, MEMBER)) |
1492 | |
1493 | // For sigaction, which is a function and struct at the same time, |
1494 | // and thus requires explicit "struct" in sizeof() expression. |
1495 | #define CHECK_STRUCT_SIZE_AND_OFFSET(CLASS, MEMBER) \ |
1496 | COMPILER_CHECK(sizeof(((struct __sanitizer_##CLASS *)NULL)->MEMBER) == \ |
1497 | sizeof(((struct CLASS *)NULL)->MEMBER)); \ |
1498 | COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) == \ |
1499 | offsetof(struct CLASS, MEMBER)) |
1500 | |
1501 | #define SIGACTION_SYMNAME sigaction |
1502 | |
1503 | #endif // SANITIZER_LINUX || SANITIZER_APPLE |
1504 | |
1505 | #endif |
1506 | |