Linux Manual Pages development
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx+linux-man@kernel.org>
To: Georg Sauthoff <mail@gms.tf>
Cc: Alejandro Colomar <alx@kernel.org>, linux-man@vger.kernel.org
Subject: Re: [PATCH v2 1/2] man/man2/adjtimex.2: Add include and macro for clock_adjtime
Date: Sat, 31 Oct 2026 18:08:38 +0100	[thread overview]
Message-ID: <auYghHohD5SYv-Bz@devuan> (raw)
In-Reply-To: <20261027003712.905789-2-mail@gms.tf>

[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]

Hi Georg,

> Date: 2026-10-27 01:37:11+0100
> From: Georg Sauthoff <mail@gms.tf>
>
> GNU libc declares clock_adjtime() when including time.h, and not when
> just sys/timex.h is included, iff support for GNU features is requested.
> 
> Verification:
> 
>     $ for i in BLAH _GNU_SOURCE; do for j in sys/timex.h time.h; do echo -n "Testing $i and $j ... "; echo -e '#define '"$i"'\n#include <'"$j"'>\nvoid f(){clock_adjtime;}' | gcc  -xc - -o /dev/null -c 2>/dev/null && echo OK || echo FAIL; done; done
>     Testing BLAH and sys/timex.h ... FAIL
>     Testing BLAH and time.h ... FAIL
>     Testing _GNU_SOURCE and sys/timex.h ... FAIL
>     Testing _GNU_SOURCE and time.h ... OK
> 
> (Test output is from a Fedora 43 system)
> 
> Signed-off-by: Georg Sauthoff <mail@gms.tf>

Thanks!  I've applied the patch.


Have a lovely day!
Alex

> ---
>  man/man2/adjtimex.2 | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/man/man2/adjtimex.2 b/man/man2/adjtimex.2
> index f12d9413e..5b9a0667b 100644
> --- a/man/man2/adjtimex.2
> +++ b/man/man2/adjtimex.2
> @@ -17,9 +17,12 @@ .SH SYNOPSIS
>  .P
>  .BI "int adjtimex(struct timex *" "buf" );
>  .P
> -.BI "int clock_adjtime(clockid_t " clk_id, " struct timex *" "buf" );
> -.P
>  .BI "int ntp_adjtime(struct timex *" buf );
> +.P
> +.BR #define\~_GNU_SOURCE "  // See feature_test_macros(7)"
> +.B #include <time.h>
> +.P
> +.BI "int clock_adjtime(clockid_t " clk_id, " struct timex *" "buf" );
>  .fi
>  .SH DESCRIPTION
>  Linux uses David L.\& Mills' clock adjustment algorithm (see RFC\ 5905).
> -- 
> 2.55.0
> 
> 

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-10-31 17:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 12:56 [PATCH v1] man/man2/adjtimex.2: Add include, macro and error for clock_adjtime Georg Sauthoff
2026-10-25 18:49 ` Alejandro Colomar
2026-10-25 21:37   ` Georg Sauthoff
2026-10-27  0:37 ` [PATCH v2 0/2] man/man2/adjtimex.2: Fix include+add error Georg Sauthoff
2026-10-27  0:37   ` [PATCH v2 1/2] man/man2/adjtimex.2: Add include and macro for clock_adjtime Georg Sauthoff
2026-10-31 17:08     ` Alejandro Colomar [this message]
2026-10-27  0:37   ` [PATCH v2 2/2] man/man2/adjtimex.2: Add error " Georg Sauthoff
2026-10-31 17:14     ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auYghHohD5SYv-Bz@devuan \
    --to=alx+linux-man@kernel.org \
    --cc=alx@kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mail@gms.tf \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox