aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-08-03 18:17:12 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-08-03 18:17:12 +0200
commit4c20d9f2b0223874e2b5ac1235d5f33fdd02589b (patch)
treee533a2de1fe3e146bb1dcd410e7c6ff6b68fa0a6 /include
parent9b1c8bf89be668a533505e5fb4405bac6eed651c (diff)
downloadbusybox-4c20d9f2b0223874e2b5ac1235d5f33fdd02589b.tar.gz
extend fractional duration support to "top -d N.N" and "timeout"
function old new delta parse_duration_str - 168 +168 sleep_for_duration - 157 +157 top_main 885 928 +43 timeout_main 269 312 +43 handle_input 571 614 +43 duration_suffixes - 40 +40 sfx 40 - -40 sleep_main 364 79 -285 ------------------------------------------------------------------------------ (add/remove: 4/1 grow/shrink: 3/1 up/down: 494/-325) Total: 169 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 94caba2bb..7cad12c44 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1018,6 +1018,14 @@ int xatoi_positive(const char *numstr) FAST_FUNC;
/* Useful for reading port numbers */
uint16_t xatou16(const char *numstr) FAST_FUNC;
+#if ENABLE_FLOAT_DURATION
+typedef double duration_t;
+void sleep_for_duration(duration_t duration) FAST_FUNC;
+#else
+typedef unsigned duration_t;
+#define sleep_for_duration(duration) sleep(duration)
+#endif
+duration_t parse_duration_str(char *str) FAST_FUNC;
/* These parse entries in /etc/passwd and /etc/group. This is desirable
* for BusyBox since we want to avoid using the glibc NSS stuff, which