zos: fix hr timer resolution

One tick on the high resolution clock (TOD clock) on z/OS
is equivalent to (1/4.096) nanoseconds.

PR-URL: https://github.com/libuv/libuv/pull/1453
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
John Barboza 2017-08-02 19:41:13 -04:00 committed by Ben Noordhuis
parent f9823e5c12
commit 04adefafdf

View File

@ -77,6 +77,9 @@
#pragma linkage(BPX4GTH, OS)
#pragma linkage(BPX1GTH, OS)
/* TOD Clock resolution in nanoseconds */
#define TOD_RES 4.096
typedef unsigned data_area_ptr_assign_type;
typedef union {
@ -122,7 +125,7 @@ uint64_t uv__hrtime(uv_clocktype_t type) {
unsigned long long timestamp;
__stckf(&timestamp);
/* Convert to nanoseconds */
return timestamp / 10;
return timestamp / TOD_RES;
}