Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,40 @@ struct __sanitizer_cmsghdr {
int cmsg_level;
int cmsg_type;
};
#else
# elif SANITIZER_MUSL
struct __sanitizer_msghdr {
void *msg_name;
unsigned msg_namelen;
struct __sanitizer_iovec *msg_iov;
# if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use SANITIZER_WORDSIZE == 64 instead of __LONG_MAX ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

int __pad1;
# endif
int msg_iovlen;
# if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
int __pad1;
# endif
void *msg_control;
# if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
int __pad2;
# endif
unsigned msg_controllen;
# if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
int __pad2;
# endif
int msg_flags;
};
struct __sanitizer_cmsghdr {
# if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __BIG_ENDIAN
int __pad1;
# endif
unsigned cmsg_len;
# if __LONG_MAX > 0x7fffffff && __BYTE_ORDER == __LITTLE_ENDIAN
int __pad1;
# endif
int cmsg_level;
int cmsg_type;
};
# else
// In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but
// many implementations don't conform to the standard.
struct __sanitizer_msghdr {
Expand All @@ -493,9 +526,9 @@ struct __sanitizer_cmsghdr {
int cmsg_level;
int cmsg_type;
};
#endif
# endif

#if SANITIZER_LINUX
# if SANITIZER_LINUX
struct __sanitizer_mmsghdr {
__sanitizer_msghdr msg_hdr;
unsigned int msg_len;
Expand Down
Loading