Re: [PATCH] add time64 copies of system calls

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

 



Hi Marcin,

On Wed, Feb 26, 2025 at 03:48:19PM +0100, Marcin Juszkiewicz wrote:
> > We absolutely can and should add documentation for the kernel syscalls since they are
> > unique syscalls that take 64-bit time_t variants for a 32-bit userspace.
> > 
> > These syscalls are the 64-bit time_t variants to allow userspace to build 32-bit targets
> > that have 64-bit time_t e.g. alternate ABI i686 with 64-bit time_t.
> > 
> > The userspace interfaces are hidden behind a 64-bit time_t though and shouldn't change
> > (though the ABI changes).
> 
> I started looking at it - wondering how much info should be there. Simple
> like patch below or more complex one?
> 
> troff is awful...

:-)

> diff --git a/man/man2/adjtimex.2 b/man/man2/adjtimex.2
> index 7a87ac654..6dde493aa 100644
> --- a/man/man2/adjtimex.2
> +++ b/man/man2/adjtimex.2
> @@ -10,7 +10,7 @@
>  .\"
>  .TH adjtimex 2 (date) "Linux man-pages (unreleased)"
>  .SH NAME
> -adjtimex, clock_adjtime, ntp_adjtime \- tune kernel clock
> +adjtimex, clock_adjtime, clock_adjtime64, ntp_adjtime \- tune kernel clock
>  .SH LIBRARY
>  Standard C library
>  .RI ( libc ,\~ \-lc )
> @@ -22,6 +22,8 @@ .SH SYNOPSIS
>  .P
>  .BI "int clock_adjtime(clockid_t " clk_id, " struct timex *" "buf" );
>  .P
> +.BI "int clock_adjtime64(clockid_t " clk_id, " struct timex *" "buf" );
> +.P

I'd move it to the bottom of the SYNOPSYS, and add a comment above
saying it's only available on 32-bit systems (if there are exact macros
that define those platforms, it would be interesting to use that):

	// Only in 32-bit systems:
	...;

or

	#if (...)
	...;
	#endif

>  .BI "int ntp_adjtime(struct timex *" buf );
>  .fi
>  .SH DESCRIPTION
> @@ -557,6 +559,10 @@ .SH STANDARDS
>  .P
>  The preferred API for the NTP daemon is
>  .BR ntp_adjtime ().
> +.SH HISTORY
> +Linux 5.1 added
> +.BR clock_adjtime64()
> +call on 32-bit architectures as part of handling Y2038 problem.

For a start, this should be enough.  We can later add some more details
if needed.  I also don't want to waste much space in the manual pages
about these.  Maybe we could have a generic description for xxx64() APIs
elsewhere, which clarifies what all of these are.  Maybe a new Y2038(7)
manual page would be a good place for that.


Have a lovely day!
Alex

>  .SH NOTES
>  In struct
>  .IR timex ,

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


[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