Re: [PATCH 2/3] system_data_types.7: Add 'clock_t'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michael,

On 2020-10-18 07:56, Michael Kerrisk (man-pages) wrote:
Hi Alex,

On 10/17/20 11:37 PM, Alejandro Colomar wrote:
Signed-off-by: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
---

Hi Michael,

Does that dash (in "real-floating") need to be escaped?

No.

In my terminal I see it correctly,
but I've seen you escaping some of them and don't know the reason why.

See man-pages(7):

    Real minus character
        Where a real minus character is required (e.g., for  numbers  such
        as  -1,  for  man  page cross references such as utf-8(7), or when
        writing options that have a leading dash, such as in  ls -l),  use
        the following form in the man page source:

            \-

        This guideline applies also to code examples.

The point is that a real-minux sign is needed to that code snippets
can be cut and pasted.

Should they be escaped always, or is it only sometimes, and when?

In normal text, no escape is needed.


Thanks.


  man7/system_data_types.7 | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)


diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
index dc5f65c0d..6a1442ccd 100644
--- a/man7/system_data_types.7
+++ b/man7/system_data_types.7
@@ -85,6 +85,28 @@ See also:
  .BR aio_write (3),
  .BR lio_listio (3)
  .RE
+.\"------------------------------------- clock_t ----------------------/
+.TP
+.I clock_t
+.RS
+Include:
+.I <time.h>
+or
+.IR <sys/types.h> .
+Alternatively,
+.IR <sys/time.h> .
+.PP
+Used for system time in clock ticks.

Please make it:
"Used for system time either in clock ticks or CLOCKS_PER_SEC"

This type has a strange history. In my book, I note:

     Although the clock_t return type of clock() is the same
     data type that is used in the times() call, the units of
     measurement employed by these two interfaces are
     different. This is the result of historically conflicting
     definitions of clock_t in POSIX.1 and the C programming
     language standard.


Ahhh now I get it. So CLOCKS_PER_SEC doesn't mean CLOCK_TICKS_PER_SEC, right? I always thought that it really was that, and clock() simply returned clock ticks. But it looks like it returns an arbitrary division of the second called CLOCKS_PER_SEC.

I'll add " or CLOCKS_PER_SEC"


+According to POSIX,
+it shall be an integer type or a real-floating type.
+.PP
+Conforming to:
+C99 and later; POSIX.1-2001 and later.
+.PP
+See also:
+.BR times (2),
+.BR clock (3)
+.RE
  .\"------------------------------------- div_t ------------------------/
  .TP
  .I div_t

Cheers,

Michael




Thanks,

Alex



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux