Skip to content

Commit f606cfd

Browse files
authored
Reorder the clockid_t values to match existing practice. (#112)
Move `CLOCK_REALTIME` to be the first `clockid_t` value. This change reflects the definitions used in [existing practice], so this patch updates the `wasi_unstable_preview0` and `wasi_unstable` definitions as well. This is the same change as #41, but updated for the WASI repository's new phases directory structure. [existing practice]: https://github.com/CraneStation/wasi-libc/blob/master/libc-bottom-half/headers/public/wasi/core.h#L42
1 parent 205f923 commit f606cfd

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

phases/ephemeral/docs/wasi_ephemeral_preview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,11 @@ Used by [`__wasi_subscription_t`](#subscription), [`__wasi_clock_res_get()`](#cl
11131113

11141114
Possible values:
11151115

1116+
- <a href="#clockid.realtime" name="clockid.realtime"></a>**`__WASI_CLOCK_REALTIME`**
1117+
1118+
The clock measuring real time. Time value
1119+
zero corresponds with 1970-01-01T00:00:00Z.
1120+
11161121
- <a href="#clockid.monotonic" name="clockid.monotonic"></a>**`__WASI_CLOCK_MONOTONIC`**
11171122

11181123
The store-wide monotonic clock, which is defined as a
@@ -1127,11 +1132,6 @@ Possible values:
11271132
The CPU-time clock associated with the current
11281133
process.
11291134

1130-
- <a href="#clockid.realtime" name="clockid.realtime"></a>**`__WASI_CLOCK_REALTIME`**
1131-
1132-
The clock measuring real time. Time value
1133-
zero corresponds with 1970-01-01T00:00:00Z.
1134-
11351135
- <a href="#clockid.thread_cputime_id" name="clockid.thread_cputime_id"></a>**`__WASI_CLOCK_THREAD_CPUTIME_ID`**
11361136

11371137
The CPU-time clock associated with the current thread.

phases/ephemeral/witx/typenames.witx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
;; Identifiers for clocks.
1717
(typename $clockid_t
1818
(enum u32
19+
;; The clock measuring real time. Time value zero corresponds with
20+
;; 1970-01-01T00:00:00Z.
21+
$CLOCK_REALTIME
1922
;; The store-wide monotonic clock, which is defined as a clock measuring
2023
;; real time, whose value cannot be adjusted and which cannot have negative
2124
;; clock jumps. The epoch of this clock is undefined. The absolute time
2225
;; value of this clock therefore has no meaning.
2326
$CLOCK_MONOTONIC
2427
;; The CPU-time clock associated with the current process.
2528
$CLOCK_PROCESS_CPUTIME_ID
26-
;; The clock measuring real time. Time value zero corresponds with
27-
;; 1970-01-01T00:00:00Z.
28-
$CLOCK_REALTIME
2929
;; The CPU-time clock associated with the current thread.
3030
$CLOCK_THREAD_CPUTIME_ID
3131
)

phases/old/docs/wasi_unstable_preview0.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,11 @@ Used by [`__wasi_subscription_t`](#subscription), [`__wasi_clock_res_get()`](#cl
11131113

11141114
Possible values:
11151115

1116+
- <a href="#clockid.realtime" name="clockid.realtime"></a>**`__WASI_CLOCK_REALTIME`**
1117+
1118+
The clock measuring real time. Time value
1119+
zero corresponds with 1970-01-01T00:00:00Z.
1120+
11161121
- <a href="#clockid.monotonic" name="clockid.monotonic"></a>**`__WASI_CLOCK_MONOTONIC`**
11171122

11181123
The store-wide monotonic clock, which is defined as a
@@ -1127,11 +1132,6 @@ Possible values:
11271132
The CPU-time clock associated with the current
11281133
process.
11291134

1130-
- <a href="#clockid.realtime" name="clockid.realtime"></a>**`__WASI_CLOCK_REALTIME`**
1131-
1132-
The clock measuring real time. Time value
1133-
zero corresponds with 1970-01-01T00:00:00Z.
1134-
11351135
- <a href="#clockid.thread_cputime_id" name="clockid.thread_cputime_id"></a>**`__WASI_CLOCK_THREAD_CPUTIME_ID`**
11361136

11371137
The CPU-time clock associated with the current thread.

phases/old/witx/typenames.witx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
;; Identifiers for clocks.
1717
(typename $clockid_t
1818
(enum u32
19+
;; The clock measuring real time. Time value zero corresponds with
20+
;; 1970-01-01T00:00:00Z.
21+
$CLOCK_REALTIME
1922
;; The store-wide monotonic clock, which is defined as a clock measuring
2023
;; real time, whose value cannot be adjusted and which cannot have negative
2124
;; clock jumps. The epoch of this clock is undefined. The absolute time
2225
;; value of this clock therefore has no meaning.
2326
$CLOCK_MONOTONIC
2427
;; The CPU-time clock associated with the current process.
2528
$CLOCK_PROCESS_CPUTIME_ID
26-
;; The clock measuring real time. Time value zero corresponds with
27-
;; 1970-01-01T00:00:00Z.
28-
$CLOCK_REALTIME
2929
;; The CPU-time clock associated with the current thread.
3030
$CLOCK_THREAD_CPUTIME_ID
3131
)

phases/unstable/docs/wasi_unstable_preview0.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,11 @@ Used by [`__wasi_subscription_t`](#subscription), [`__wasi_clock_res_get()`](#cl
11131113

11141114
Possible values:
11151115

1116+
- <a href="#clockid.realtime" name="clockid.realtime"></a>**`__WASI_CLOCK_REALTIME`**
1117+
1118+
The clock measuring real time. Time value
1119+
zero corresponds with 1970-01-01T00:00:00Z.
1120+
11161121
- <a href="#clockid.monotonic" name="clockid.monotonic"></a>**`__WASI_CLOCK_MONOTONIC`**
11171122

11181123
The store-wide monotonic clock, which is defined as a
@@ -1127,11 +1132,6 @@ Possible values:
11271132
The CPU-time clock associated with the current
11281133
process.
11291134

1130-
- <a href="#clockid.realtime" name="clockid.realtime"></a>**`__WASI_CLOCK_REALTIME`**
1131-
1132-
The clock measuring real time. Time value
1133-
zero corresponds with 1970-01-01T00:00:00Z.
1134-
11351135
- <a href="#clockid.thread_cputime_id" name="clockid.thread_cputime_id"></a>**`__WASI_CLOCK_THREAD_CPUTIME_ID`**
11361136

11371137
The CPU-time clock associated with the current thread.

phases/unstable/witx/typenames.witx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
;; Identifiers for clocks.
1717
(typename $clockid_t
1818
(enum u32
19+
;; The clock measuring real time. Time value zero corresponds with
20+
;; 1970-01-01T00:00:00Z.
21+
$CLOCK_REALTIME
1922
;; The store-wide monotonic clock, which is defined as a clock measuring
2023
;; real time, whose value cannot be adjusted and which cannot have negative
2124
;; clock jumps. The epoch of this clock is undefined. The absolute time
2225
;; value of this clock therefore has no meaning.
2326
$CLOCK_MONOTONIC
2427
;; The CPU-time clock associated with the current process.
2528
$CLOCK_PROCESS_CPUTIME_ID
26-
;; The clock measuring real time. Time value zero corresponds with
27-
;; 1970-01-01T00:00:00Z.
28-
$CLOCK_REALTIME
2929
;; The CPU-time clock associated with the current thread.
3030
$CLOCK_THREAD_CPUTIME_ID
3131
)

0 commit comments

Comments
 (0)