summaryrefslogtreecommitdiff
path: root/src/testing/nosleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/nosleep.c')
-rw-r--r--src/testing/nosleep.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testing/nosleep.c b/src/testing/nosleep.c
new file mode 100644
index 000000000..dbbe40baf
--- /dev/null
+++ b/src/testing/nosleep.c
@@ -0,0 +1,29 @@
+/*++
+/* NAME
+/* nosleep 3
+/* SUMMARY
+/* override the system sleep(3) implementation
+/* SYNOPSIS
+/* LD_PRELOAD=/path/to/nosleep.so command....
+/*
+/* int sleep(unsigned int seconds)
+/* DESCRIPTION
+/* This sleep(3) implementation returns zero immediately. The purpose
+/* is to speed up error handler tests by skipping the delay between
+/* reporting a fatal error and before terminating the process.
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* porcupine.org
+/*--*/
+
+#include <unistd.h>
+
+unsigned int sleep(unsigned int seconds)
+{
+ /* Don't sleep. */
+ return (0);
+}