[PATCH] D105878: [sanitizer_common] Define internal_usleep on Solaris
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 13 02:10:58 PDT 2021
ro updated this revision to Diff 358200.
ro added a comment.
Ignore remaining time from `nanosleep`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105878/new/
https://reviews.llvm.org/D105878
Files:
compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
Index: compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -160,6 +160,13 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105878.358200.patch
Type: text/x-patch
Size: 674 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210713/3523820e/attachment.bin>
More information about the llvm-commits
mailing list