~nabijaczleweli/wg14

ebf59365529e23b226e1e9f244e71b2871bf421b — наб 2 years ago 0962402
clock_t twice :v
1 files changed, 8 insertions(+), 24 deletions(-)

M N????.mom
M N????.mom => N????.mom +8 -24
@@ 27,28 27,20 @@
.COVER_LEAD     +3.5
.DOCHEADER_LEAD +3.5
.\" Color for code snippets
.NEWCOLOUR dark-grey RGB #343434
.XCOLOR    darkgreen green
.XCOLOR        red   red
.NEWCOLOUR darkwhite RGB #A0A0A0
.\" Make QUOTE look like CODE
.NEWCOLOUR darkwhite RGB #909090
.\"
.QUOTE_FAMILY C
.QUOTE_FONT   B
.QUOTE_SIZE   +1.5
.QUOTE_COLOR  dark-grey
.QUOTE_INDENT 9p
.\"
.CODE_FONT  B
.CODE_SIZE  115
.CODE_COLOR dark-grey
.CONDENSE   87
.\"
.HEADING_STYLE 1 NUMBER FONT B SIZE +1 BASELINE_ADJUST \n[.v]/5
.HEADING_STYLE 2 NUMBER FONT I SIZE +.25 BASELINE_ADJUST \n[.v]/5
.HEADING_STYLE 2 NUMBER FONT I SIZE +.5 BASELINE_ADJUST \n[.v]/5
.\" Wrapper around QUOTE
.de COD
. QUOTE
. nop \*[COND]\\$*\*[CONDX]
. nop \\$*
. QUOTE OFF
..
.\" Note box


@@ 83,10 75,8 @@ The range and precision of times representable in \f(CBclock_t\fP and \f(CBtime_
The \f(CBtimespec\fP structure shall contain at least the following members, in any order.
The semantics of the members and their normal ranges are expressed in the comments.\*[SUP]342)\*[SUPX]
.QUOTE
\*[COND]
time_t tv_sec;  // whole seconds -- ≥ 0
long   tv_nsec; // nanoseconds -- [0, 999999999]
\*[CONDX]
.QUOTE OFF
.in
However, this presents a small set of problems:


@@ 104,22 94,18 @@ Under Linux®, on the
.PDF_WWW_LINK https://raw.githubusercontent.com/wiki/hjl-tools/x86-psABI/x86-64-psABI-1.0.pdf X32
ABI, the kernel's \f(CBstruct timespec\fP is invariably
.QUOTE
\*[COND]
struct timespec {
  time_t tv_sec;
  long   tv_nsec;
};
\*[CONDX]
.QUOTE OFF
under the \fIkernel ABI\fP: the LP64 AMD64.
This means that from the ILP32 userspace, it looks like this:
.QUOTE
\*[COND]
struct timespec {
  time_t  tv_sec;
  int64_t tv_nsec;
};
\*[CONDX]
.QUOTE OFF
The shortest available \f(CBint64_t\fP is \f(CBlong long\fP,
and the libc \fImust\fP expose a kernel-ABI-compatible \f(CBtimespec\fR


@@ 131,10 117,10 @@ and the libc \fImust\fP expose a kernel-ABI-compatible \f(CBtimespec\fR
The types declared are \f(CBsize_t\fP (described in 7.19);
.COD clock_t
and
.COD clock_t
.COD time_t
which are real types capable of representing times;
.COD \*[green]nsec_t
\*[green]which is an implementation-defined integer type capable of representing the range [0, 999999999];\*[dark-grey]
\*[green]which is an implementation-defined integer type capable of representing the range [0, 999999999];\*[\*[default]]
.COD struct timespec
which holds and interval specified in seconds and nanoseconds (which may represent a calendar time based on a particular epoch); and
.COD struct tm


@@ 147,13 133,11 @@ The range and precision of times representable in \f(CBclock_t\fP and \f(CBtime_
The \f(CBtimespec\fP structure shall contain at least the following members, in any order.
The semantics of the members and their normal ranges are expressed in the comments.\*[SUP]342)\*[SUPX]
.QUOTE
\*[COND]
time_t tv_sec;  // whole seconds -- ≥ 0
\*[red]\o'l\(em'\o'o\(em'\o'n\(em'\o'g\(em'\o'\ \(em'\o'\ \(em'\o'\ \(em'\o't\(em'\o'v\(em'\o'_\(em'\o'n\(em'\o's\(em'\o'e\(em'\o'c\(em'\o';\(em'\o'\ \(em'\o'/\(em'\o'/\(em'\o'\ \(em'\o'n\(em'\o'a\(em'\o'n\(em'\o'o\(em'\o's\(em'\o'e\(em'\o'c\(em'\o'o\(em'\o'n\(em'\o'd\(em'\o's\(em'\o'\ \(em'\o'-\(em'\o'-\(em'\o'\ \(em'\o'[\(em'\o'0\(em'\o',\(em'\o'\ \(em'\o'9\(em'\o'9\(em'\o'9\(em'\o'9\(em'\o'9\(em'\o'9\(em'\o'9\(em'\o'9\(em'\o'9\(em'\o']\(em'
\*[green]nsec_t tv_nsec; // nanoseconds -- [0, 999999999]
\*[CONDX]
.QUOTE OFF
The \f(CBtm\fP structure shall… \*[darkwhite][rest of section unchanged]\*[\*[default]]
The \f(CBtm\fP structure shall\*[darkwhite]… [rest of section unchanged]\*[\*[default]]
.in
.
.HEADING 1 NAMED rationale "Rationale"


@@ 161,7 145,7 @@ The \f(CBtm\fP structure shall… \*[darkwhite][rest of section unchanged]\*[\*[
Being strictly additive, this changes nothing on already-conforming implementations:
\f(CBnsec_t\fP can simply continue to be \f(CBlong\fP.
.PP
However, this enforces the need to cast \f(CBtv_nsec\fP to a concrete type for formatting,
However, this enforces the need to cast \f(CBtv_nsec\fP to a concrete type for formatting
or other processing, and allows user code to actually store it in its original form.
.
.HEADING 1 NAMED references "References"