[PATCH] D36399: [sanitizers] Add a blocking boolean to GetRandom prototype

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 10:00:48 PDT 2017


cryptoad added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1685
+#  define GRND_NONBLOCK 1
+# endif
   static atomic_uint8_t skip_getrandom_syscall;
----------------
alekseyshl wrote:
> Can you move those defines to the top of the file and define SANITIZER_USE_GETRANDOM? Then here you can do 
> 
>   if (SANITIZER_USE_GETRANDOM) {
>     ...
>   }
So the compiler still wants `SYSCALL(getrandom)` and `GRND_NONBLOCK` to be defined with an `if` rather than an `#if`.
I am unsure how to cleanly address that. Macroing the internal_syscall part to do nothing?




https://reviews.llvm.org/D36399





More information about the llvm-commits mailing list