aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Unix/Process.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Unix/Process.inc')
-rw-r--r--lib/Support/Unix/Process.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc
index f640462a45..de982625e9 100644
--- a/lib/Support/Unix/Process.inc
+++ b/lib/Support/Unix/Process.inc
@@ -297,3 +297,12 @@ const char *Process::OutputReverse() {
const char *Process::ResetColor() {
return "\033[0m";
}
+
+unsigned llvm::sys::Process::GetRandomNumber() {
+#if defined(HAVE_ARC4RANDOM)
+ return arc4random();
+#else
+ static int x = (::srand(::time(NULL)), 0);
+ return ::rand();
+#endif
+}