From aeb5222a6d7f7e9be5b737e2dbaf71185a9946db Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 18 Jul 2011 10:49:17 +0100 Subject: timeout: support sub-second timeouts * src/timeout.c (settimeout): A new function to convert from a floating point duration and call alarm() or timer_settime() if that's available. (parse_duration): Return a double rather than unsigned int. (usage): Mention floating point is supported. (main): Pass the double to settimeout() rather than calling alarm() directly with the parsed int. (cleanup): Likewise. * doc/coreutils.texi (timeout invocation): Say floating point timeouts now supported, and mention the caveat with resolution. * bootstrap.conf: Include the timer-time gnulib module. * tests/misc/timeout-parameters: Add a test with nanoseconds. * NEWS: Mention the improvement. --- tests/misc/timeout-parameters | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/misc/timeout-parameters') diff --git a/tests/misc/timeout-parameters b/tests/misc/timeout-parameters index 56804a808..e34a72807 100755 --- a/tests/misc/timeout-parameters +++ b/tests/misc/timeout-parameters @@ -55,6 +55,9 @@ test $? = 0 || fail=1 timeout 2.34e+5d sleep 0 test $? = 0 || fail=1 +# nanoseconds potentially supported +timeout .999999999 sleep 0 || fail=1 + # invalid signal spec timeout --signal=invalid 1 sleep 0 test $? = 125 || fail=1 -- cgit v1.2.3-54-g00ecf