forked from OSchip/llvm-project
[sanitizer_common] Define internal_usleep on Solaris
The Solaris/amd64 buildbot <https://lab.llvm.org/staging/#/builders/101/builds/2845> has recently been broken several times, at least one of those remains unfixed: [63/446] Generating Sanitizer-x86_64-Test [...] Undefined first referenced symbol in file _ZN11__sanitizer15internal_usleepEy /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/stage1/projects/compiler-rt/lib/sanitizer_common/tests/libRTSanitizerCommon.test.x86_64.a(sanitizer_common.cpp.o) ld: fatal: symbol referencing errors Thist patch fixes it by defining the missing `internal_usleep`. Tested on `amd64-pc-solaris2.11.` Differential Revision: https://reviews.llvm.org/D105878
This commit is contained in:
parent
1d8030053d
commit
45430983ef
|
@ -160,6 +160,13 @@ DECLARE__REAL_AND_INTERNAL(uptr, sched_yield, void) {
|
|||
return sched_yield();
|
||||
}
|
||||
|
||||
DECLARE__REAL_AND_INTERNAL(void, usleep, u64 useconds) {
|
||||
struct timespec ts;
|
||||
ts.tv_sec = useconds / 1000000;
|
||||
ts.tv_nsec = (useconds % 1000000) * 1000;
|
||||
nanosleep(&ts, nullptr);
|
||||
}
|
||||
|
||||
DECLARE__REAL_AND_INTERNAL(uptr, execve, const char *filename,
|
||||
char *const argv[], char *const envp[]) {
|
||||
return _REAL(execve)(filename, argv, envp);
|
||||
|
|
Loading…
Reference in New Issue