[compiler-rt][sanitizer] fix msghdr for musl (#136195) · llvm/llvm-project@2cb08db (original) (raw)
File tree
1 file changed
lines changed
- compiler-rt/lib/sanitizer_common
1 file changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -478,6 +478,30 @@ struct __sanitizer_cmsghdr { | ||
| 478 | 478 | int cmsg_level; |
| 479 | 479 | int cmsg_type; |
| 480 | 480 | }; |
| 481 | +# elif SANITIZER_MUSL | |
| 482 | +struct __sanitizer_msghdr { | |
| 483 | +void *msg_name; | |
| 484 | +unsigned msg_namelen; | |
| 485 | +struct __sanitizer_iovec *msg_iov; | |
| 486 | +int msg_iovlen; | |
| 487 | +# if SANITIZER_WORDSIZE == 64 | |
| 488 | +int __pad1; | |
| 489 | +# endif | |
| 490 | +void *msg_control; | |
| 491 | +unsigned msg_controllen; | |
| 492 | +# if SANITIZER_WORDSIZE == 64 | |
| 493 | +int __pad2; | |
| 494 | +# endif | |
| 495 | +int msg_flags; | |
| 496 | +}; | |
| 497 | +struct __sanitizer_cmsghdr { | |
| 498 | +unsigned cmsg_len; | |
| 499 | +# if SANITIZER_WORDSIZE == 64 | |
| 500 | +int __pad1; | |
| 501 | +# endif | |
| 502 | +int cmsg_level; | |
| 503 | +int cmsg_type; | |
| 504 | +}; | |
| 481 | 505 | # else |
| 482 | 506 | // In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but |
| 483 | 507 | // many implementations don't conform to the standard. |