glibc/glibc-RHEL-57585-4.patch
Tulio Magno Quites Machado Filho cadb5c6bdc Backport documentation for time functions
Resolves: RHEL-57585
2025-02-19 14:45:09 -03:00

114 lines
5.1 KiB
Diff

commit 83a1cc3bc3d28c97d1af6c0957b11fe39fd786d8
Author: Carlos O'Donell <carlos@redhat.com>
Date: Wed Oct 9 18:32:26 2024 -0400
Part of this patch got merged with glibc-RHEL-65356-2.patch however,
the documentation part got removed at the time.
This patch adds the missing documentation that got removed from
glibc-RHEL-65356-2.patch.
--- 8< ---
manual: Fix and test @deftypef* function formatting
The manual contained several instances of incorrect formatting
that were correct texinfo but produced incorrectly rendered manuals
or incorrect behaviour from the tooling.
The most important was incorrect quoting of function returns
by failing to use {} to quote the return. The impact of this
mistake means that 'info libc func' does not jump to the function
in question but instead to the introductory page under the assumption
that func doesn't exist. The function returns are now correctly
quoted.
The second issue was the use of a category specifier with
@deftypefun which doesn't accept a category specifier. If a category
specifier is required then @deftypefn needs to be used. This is
corrected by changing the command to @deftypefn for such functions
that used {Deprecated function} as a category.
The last issue is a missing space between the function name and the
arguments which results in odd function names like "epoll_wait(int"
instead of "epoll_wait". This also impacts the use of 'info libc'
and is corrected.
We additionally remove ';' from the end of function arguments and
add an 'int' return type for dprintf.
Lastly we add a new test check-deftype.sh which verifies the expected
formatting of @deftypefun, @deftypefunx, @deftypefn, and
@deftypefnx. The new test is also run as the summary file is
generated to ensure we don't generate incorrect results.
The existing check-safety.sh is also run directly as a test to increase
coverage since the existing tests only ran on manual install.
The new tests now run as part of the standard "make check" that
pre-commit CI runs and developers should run.
No regressions on x86_64.
HTML and PDF rendering reviewed and looks correct for all changes.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/manual/time.texi b/manual/time.texi
index 39e1a7457e11e538..3e8a46a6bfe96e5d 100644
--- a/manual/time.texi
+++ b/manual/time.texi
@@ -1829,7 +1829,7 @@ can be placed in the buffer @var{s} the return value is zero, with the
same problems indicated in the @code{strftime} documentation.
@end deftypefun
-@deftypefun {Deprecated function} {char *} asctime (const struct tm *@var{brokentime})
+@deftypefn {Deprecated function} {char *} asctime (const struct tm *@var{brokentime})
@standards{ISO, time.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:asctime} @mtslocale{}}@asunsafe{}@acsafe{}}
@c asctime @mtasurace:asctime @mtslocale
@@ -1863,9 +1863,9 @@ string.)
@strong{Portability note:}
This obsolescent function is deprecated in C23.
Programs should instead use @code{strftime} or even @code{sprintf}.
-@end deftypefun
+@end deftypefn
-@deftypefun {Deprecated function} {char *} asctime_r (const struct tm *@var{brokentime}, char *@var{buffer})
+@deftypefn {Deprecated function} {char *} asctime_r (const struct tm *@var{brokentime}, char *@var{buffer})
@standards{???, time.h}
@safety{@prelim{}@mtsafe{@mtslocale{}}@assafe{}@acsafe{}}
@c asctime_r @mtslocale
@@ -1884,9 +1884,9 @@ it returns @code{NULL}.
@strong{Portability Note:}
POSIX.1-2024 removed this obsolescent function.
Programs should instead use @code{strftime} or even @code{sprintf}.
-@end deftypefun
+@end deftypefn
-@deftypefun {Deprecated function} {char *} ctime (const time_t *@var{time})
+@deftypefn {Deprecated function} {char *} ctime (const time_t *@var{time})
@standards{ISO, time.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:tmbuf} @mtasurace{:asctime} @mtsenv{} @mtslocale{}}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsmem{} @acsfd{}}}
@c ctime @mtasurace:tmbuf @mtasurace:asctime @mtsenv @mtslocale @ascuheap @asulock @aculock @acsmem @acsfd
@@ -1909,9 +1909,9 @@ Calling @code{ctime} also sets the time zone state as if
@strong{Portability note:}
This obsolescent function is deprecated in C23.
Programs should instead use @code{strftime} or even @code{sprintf}.
-@end deftypefun
+@end deftypefn
-@deftypefun {Deprecated function} {char *} ctime_r (const time_t *@var{time}, char *@var{buffer})
+@deftypefn {Deprecated function} {char *} ctime_r (const time_t *@var{time}, char *@var{buffer})
@standards{???, time.h}
@safety{@prelim{}@mtsafe{@mtsenv{} @mtslocale{}}@asunsafe{@ascuheap{} @asulock{}}@acunsafe{@aculock{} @acsmem{} @acsfd{}}}
@c ctime_r @mtsenv @mtslocale @ascuheap @asulock @aculock @acsmem @acsfd
@@ -1935,7 +1935,7 @@ it returns @code{NULL}.
@strong{Portability Note:}
POSIX.1-2024 removed this obsolescent function.
Programs should instead use @code{strftime} or even @code{sprintf}.
-@end deftypefun
+@end deftypefn
@node Parsing Date and Time
@subsection Convert textual time and date information back