[PATCH v2] manual: clarify _FILE_OFFSET_BITS Y2038 implications [BZ #34095]
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Apr 24 18:33:03 GMT 2026
On 23/04/26 21:55, Shamil Abdulaev wrote:
> Changes in v2:
> - Instead of removing the Y2038 note, clarify its relationship to
> _FILE_OFFSET_BITS
> - Explicitly document the transitive dependency: _TIME_BITS=64
> requires _FILE_OFFSET_BITS=64
> - Address feedback from Mark Harris that the existing wording causes confusion
>
> ---
>
> The existing paragraph warning about _FILE_OFFSET_BITS default changes
> due to Y2038 is correct but confusing, as it does not explicitly state
> why time_t concerns affect _FILE_OFFSET_BITS.
>
> Clarify that _TIME_BITS=64 (needed for Y2038 safety) requires
> _FILE_OFFSET_BITS=64, so when systems migrate to 64-bit time_t by
> default, _FILE_OFFSET_BITS will also need to default to 64, even for
> applications that do not handle large files.
>
> This addresses the confusion noted in the bug report while keeping the
> warning in place, as the transitive dependency makes it relevant to
> the _FILE_OFFSET_BITS documentation.
>
> Signed-off-by: Shamil Abdulaev <ashamil435@gmail.com>
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> manual/creature.texi | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/manual/creature.texi b/manual/creature.texi
> index 90f9f8e35b..1a2c5e8f9d 100644
> --- a/manual/creature.texi
> +++ b/manual/creature.texi
> @@ -161,10 +161,13 @@ under different names (as they are with
> @code{_LARGEFILE64_SOURCE}).
> Instead the old function names now reference the new functions, e.g., a
> call to @code{fseeko} now indeed calls @code{fseeko64}.
>
> If the macro is not defined it currently defaults to @code{32}, but
> -this default is planned to change due to a need to update
> -@code{time_t} for Y2038 safety, and applications should not rely on
> -the default.
> +this default is planned to change in the future. This is because
> +@code{_TIME_BITS=64} (required for @code{time_t} Y2038 safety) can
> +only be used together with @code{_FILE_OFFSET_BITS=64}. When systems
> +migrate to 64-bit @code{time_t} by default, @code{_FILE_OFFSET_BITS}
> +will also need to default to @code{64}, even for applications that
> +do not handle large files. Applications should not rely on the
> +current default.
>
> This macro should only be selected if the system provides mechanisms for
> handling large files. On @w{64 bit} systems this macro has no effect
> --
> 2.54.0
More information about the Libc-alpha
mailing list