sanitizer_common: sanitize time functions
We have SleepForSeconds, SleepForMillis and internal_sleep. Some are implemented in terms of libc functions, some -- in terms of syscalls. Some are implemented in per OS files, some -- in libc/nolibc files. That's unnecessary complex and libc functions cause crashes in some contexts because we intercept them. There is no single reason to have calls to libc when we have syscalls (and we have them anyway). Add internal_usleep that is implemented in terms of syscalls per OS. Make SleepForSeconds/SleepForMillis/internal_sleep a wrapper around internal_usleep that is implemented in sanitizer_common.cpp once. Also remove return values for internal_sleep, it's not used anywhere. Eventually it would be nice to remove SleepForSeconds/SleepForMillis/internal_sleep. There is no point in having that many different names for the same thing. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D105718
Loading
Please sign in to comment