Skip to content

timeout: 0x1d should be parsed as 29 seconds, not 1 day #7671

@drinkcat

Description

@drinkcat

Inspired by this discussion: https://lists.gnu.org/archive/html/bug-coreutils/2025-04/msg00008.html

$ strace -e trace=clock_nanosleep sleep 0xad
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=173, tv_nsec=0},

Here 0xad is interpreted as 173 seconds, not 10 days.

Given FreeBSD and ksh sleep implementations also behave like GNU,
we should probably just document the edge case that
(day) suffixes are best avoided with hex inputs.

We currently parse 0x1d as 1 day, not 29 seconds.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions