[Sanitizer] openbsd build fix

sysctl has a different signature under OpenBSD

Reviewers: krytarowski

Reviewed By: krytarowski

Differential Revision: https://reviews.llvm.org/D51572

llvm-svn: 341285
This commit is contained in:
David Carlier 2018-09-02 09:08:50 +00:00
parent 81b61a8291
commit e858aa6565
1 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,7 @@
#endif
#if SANITIZER_OPENBSD
#include <sys/futex.h>
#include <sys/sysctl.h>
#endif
#include <unistd.h>
@ -818,7 +819,12 @@ int internal_fork() {
#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_OPENBSD
int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
uptr *oldlenp, const void *newp, uptr newlen) {
#if SANITIZER_OPENBSD
return sysctl(name, namelen, oldp, (size_t *)oldlenp, (void *)newp,
(size_t)newlen);
#else
return sysctl(name, namelen, oldp, (size_t *)oldlenp, newp, (size_t)newlen);
#endif
}
#endif