summaryrefslogtreecommitdiff
path: root/src/testing/nosleep.c
diff options
context:
space:
mode:
authorbeatrice <beatrice@dangofactory.net>2026-11-22 19:19:03 +0900
committerbeatrice <beatrice@dangofactory.net>2026-11-22 19:19:03 +0900
commitbd4611555e18fca7c66afaef0f094e15038b0459 (patch)
tree1b1a9109567b61ac259ead146f4bef21a0f886df /src/testing/nosleep.c
parent2324a9e97a727bf95690c9fb8fdca0f52301940e (diff)
downloadpostfix-master.tar.gz
postfix-master.zip
Release tarball postfix-3.11.7.tar.gz (dist-generated files / local differences from tag)HEADlocal/postfixmaster
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);
+}