GNU Timeout issue

I’m seeing an issue with the gtimeout command, and I was hoping to get confirmation that it’s a bug and not a misunderstanding on my side.

From the docs, timeout should accept fractional values. However, in my tests it always rounds up to the nearest second:

$ time gtimeout .5 sleep 3
gtimeout .5 sleep 3  0.00s user 0.01s system 0% cpu 1.019 total

This is with GNU coreutils 8.32 installed.

Trying the same command on a linux box gives the expected .5 second delay:

$ time timeout 0.5s sleep 3

real	0m0.510s
user	0m0.005s
sys	0m0.007s

Can others reproduce this? If so, should I file a bug report with homebrew or with GNU directly?

You should file an issue with GNU if you think there is a bug in the software or documentation.

timeout(1) uses timer_settime() on GNU/Linux,
but falls back to using alarm() on Darwin.

It could potentially use setitimer() to get microsecond resolution on Darwin

If that’s the core issue, then it definitely should be addressed upstream, not as a custom Homebrew patch that potentially needs to be revisited on every version bump.