hurd compatibility changes
authorMichael Tokarev <mjt@tls.msk.ru>
Thu, 3 Nov 2022 17:49:33 +0000 (20:49 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 17 Apr 2026 08:02:47 +0000 (11:02 +0300)
Hurd does not define PIPE_BUF, so lib/tevent/testsuite.c fails to compile
(yes, this file is used as part of *samba* testsuite, not tevent testsuite).
Define it to a safe minimal value like 512 bytes.

Hurd does not provide SA_NOCLDWAIT define, so lib/util/tests/tfork.c does
not compile. This is only needed during testing to omit zombie process
generation, which has only cosmetic effect.  Define it to be 0.

Based on prior work and ideas by Samuel Thibault.

Gbp-Pq: Name hurd-compat.patch

lib/tevent/testsuite.c
lib/util/tests/tfork.c

index 040e003934a06bf5dec660ece87b695192c2445c..21553023645ec04e67331e450dc5566b5eac1823 100644 (file)
 #include "system/threads.h"
 #include <assert.h>
 #endif
+#include <limits.h>
+#ifndef PIPE_BUF /* eg hurd does not define it */
+# define PIPE_BUF 512 /* a safe bet */
+#endif
 
 static struct tevent_context *
 test_tevent_context_init(TALLOC_CTX *mem_ctx)
index 19237a5156f8f9b2f615796665dc0091df1e9d7e..86e4fa7a60b9e939877b22499f9de9399fcce965 100644 (file)
@@ -33,6 +33,9 @@
 #ifdef HAVE_PTHREAD
 #include <pthread.h>
 #endif
+#ifndef SA_NOCLDWAIT
+#define SA_NOCLDWAIT 0
+#endif
 
 static bool test_tfork_simple(struct torture_context *tctx)
 {