lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 May 2021 12:01:59 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Willy Tarreau <w@....eu>
Cc:     linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: [PATCH] tools/nolibc: Implement msleep()

Allow users to implement shorter delays than a full second by implementing
msleep().

Signed-off-by: Mark Brown <broonie@...nel.org>
---
 tools/include/nolibc/nolibc.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h
index 8b7a9830dd22..d045d8bb5f0a 100644
--- a/tools/include/nolibc/nolibc.h
+++ b/tools/include/nolibc/nolibc.h
@@ -2243,6 +2243,14 @@ unsigned int sleep(unsigned int seconds)
 		return 0;
 }
 
+static __attribute__((unused))
+void msleep(unsigned int msecs)
+{
+	struct timeval my_timeval = { 0, msecs * 1000 };
+
+	sys_select(0, 0, 0, 0, &my_timeval);
+}
+
 static __attribute__((unused))
 int stat(const char *path, struct stat *buf)
 {
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ