forked from OSchip/llvm-project
[sanitizer][fuchsia] Avoid deprecated syscall.
The zx_clock_get syscall on Fuchsia is deprecated - ref https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get This changes to the recommended replacement; calling zx_clock_read on the userspace UTC clock. Reviewed By: mcgrathr, phosek Differential Revision: https://reviews.llvm.org/D90169
This commit is contained in:
parent
ddfe4784cc
commit
5a3077f3a7
|
@ -14,10 +14,6 @@
|
|||
#include "sanitizer_fuchsia.h"
|
||||
#if SANITIZER_FUCHSIA
|
||||
|
||||
#include "sanitizer_common.h"
|
||||
#include "sanitizer_libc.h"
|
||||
#include "sanitizer_mutex.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -25,6 +21,11 @@
|
|||
#include <zircon/errors.h>
|
||||
#include <zircon/process.h>
|
||||
#include <zircon/syscalls.h>
|
||||
#include <zircon/utc.h>
|
||||
|
||||
#include "sanitizer_common.h"
|
||||
#include "sanitizer_libc.h"
|
||||
#include "sanitizer_mutex.h"
|
||||
|
||||
namespace __sanitizer {
|
||||
|
||||
|
@ -47,8 +48,10 @@ unsigned int internal_sleep(unsigned int seconds) {
|
|||
}
|
||||
|
||||
u64 NanoTime() {
|
||||
zx_handle_t utc_clock = _zx_utc_reference_get();
|
||||
CHECK_NE(utc_clock, ZX_HANDLE_INVALID);
|
||||
zx_time_t time;
|
||||
zx_status_t status = _zx_clock_get(ZX_CLOCK_UTC, &time);
|
||||
zx_status_t status = _zx_clock_read(utc_clock, &time);
|
||||
CHECK_EQ(status, ZX_OK);
|
||||
return time;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue