Re: [PATCH v2 3/4] system_data_types.7: correct struct timespec::tv_nsec type for x32

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

 



Hi наб,

On 12/6/21 21:12, наб wrote:
diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
index 1e6a3f74c..80679b180 100644
--- a/man7/system_data_types.7
+++ b/man7/system_data_types.7
@@ -1544,7 +1544,11 @@ or
  .EX
  struct timespec {
      time_t  tv_sec;  /* Seconds */
+#if !(__x86_64__ && __ILP32__ /* == x32 */)
      long    tv_nsec; /* Nanoseconds [0 .. 999999999] */
+#else
+    long long tv_nsec;
+#endif

I prefer showing there the (simple) POSIX definition, and then in Notes add a message that glibc uses a different type on most systems. Otherwise, we're loosing the information that non-glibc systems use long.

How about something like the following?:

Notes: glibc uses long long instead of long for tv_nsec in some architectures:

	#if !(__x86_64__ && __ILP32__ /* == x32 */)
		long      tv_nsec;
	#else
		long long tv_nsec;
	#endif


BTW, I don't understand why long long, if long can perfectly represent 0 .. 999999999. If you know the rationale for such extension, it would be a great addition to Notes too.

Thanks!

Alex

  };
  .EE
  .PP



--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[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