Skip to content

man/man2/adjtimex.2: Fix include+add error

Georg Sauthoff linux-man 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v11 patch 2 repliesSuperseded

Changes in v2 from the cover letter

- split patch into series
- use define-style feature macro instead of extra section
- fix font style macro usage

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2man/man2/adjtimex.2: Add include and macro for clock_adjtimeman/man2/adjtimex.2+5 -21 reply
2/2man/man2/adjtimex.2: Add error for clock_adjtimeman/man2/adjtimex.2+6 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] man/man2/adjtimex.2: Fix include+add error

Hello,

this series fixes the include instructions for clock_adjtime() and documents another error its invocation may yield.

Changes v1 -> v2:
- split patch into series
- use define-style feature macro instead of extra section
- fix font style macro usage

Best regards,
Georg

Georg Sauthoff (2):
man/man2/adjtimex.2: Add include and macro for clock_adjtime man/man2/adjtimex.2: Add error for clock_adjtime

 man/man2/adjtimex.2 | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Range-diff against v1:
1: ddd4886f0 ! 1: 1f6278005 man/man2/adjtimex.2: Add include, macro and error for clock_adjtime
@@ Metadata
Author: Georg Sauthoff <[email protected]>

## Commit message ##
- man/man2/adjtimex.2: Add include, macro and error for clock_adjtime
+ man/man2/adjtimex.2: Add include and macro for clock_adjtime

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.
@@ Commit message

(Test output is from a Fedora 43 system)

- The ERANGE error can be verified either via trying to adjust the
- frequency of a PHC by a value that is outside of [-X,X],
- where X=cat /sys/class/ptp/ptpX/max_adjustment,
- or via checking the kernel source code:
-
- <https://elixir.bootlin.com/linux/v7.2.2/source/drivers/ptp/ptp_clock.c#L164>
-
## man/man2/adjtimex.2 ##
@@ man/man2/adjtimex.2: .SH SYNOPSIS
.P
@@ man/man2/adjtimex.2: .SH SYNOPSIS
-.P
.BI "int ntp_adjtime(struct timex *" buf );
+.P
-+.BR #include <time.h>
++.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
-+.P
-+.RS -4
-+Feature Test Macro Requirements for glibc (see
-+.BR feature_test_macros (7)):
-+.RE
-+.P
-+.BR clock_adjtime ():
-+.nf
-+ _GNU_SOURCE
.fi
.SH DESCRIPTION
Linux uses David L.\& Mills' clock adjustment algorithm (see RFC\ 5905).
-@@ man/man2/adjtimex.2: .SH ERRORS
- Under Linux, the
- .B CAP_SYS_TIME
- capability is required.
-+.TP
-+.B ERANGE
-+The frequency offset supplied with
-+.BR clock_adjtime ()
-+is outside of the range clock clk_id supports.
-+See also /sys/class/ptp/ptpX/max_adjustment when adjusting a PTP hardware clock.
- .SH ATTRIBUTES
- For an explanation of the terms used in this section, see
- .BR attributes (7).
-: --------- > 2: 578a02146 man/man2/adjtimex.2: Add error for clock_adjtime

Signature · 1 line
2.55.0