bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#79232: tsort doesn't support -w added by POSIX 2024.


From: Collin Funk
Subject: bug#79232: tsort doesn't support -w added by POSIX 2024.
Date: Wed, 13 Aug 2025 19:28:26 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

POSIX 2024 added the -w option to tsort. Here is the description:

    -w
        Set the exit status to the number of cycles found in the input,
        or to an implementation-defined maximum if there are more cycles
        than that maximum. If no cycles are found, the exit status shall
        be zero unless another error occurs.

The rational adds some recommendations on behavior:

    At the time that the -w option was added to this standard, the only
    known implementation reported a maximum of 255 cycles via the exit
    status. This has the drawback that applications cannot distinguish,
    from the exit status, errors caused by cycles from other errors or
    (when tsort is executed from a shell) termination by a signal.
    Implementations are urged to set the implementation-defined maximum
    number of cycles reported via the exit status to at most 124,
    leaving values above that maximum through 125 for other errors, and
    leaving values 126 and greater to have the special meanings that the
    shell assigns to them.

I'll have a look at implementing this behavior. But figured it was worth
sending on bug-coreutils for tracking like the rest of the missing POSIX
2024 features.

Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/tsort.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]