$OpenBSD: patch-third_party_libsync_src_sync_c,v 1.3 2021/10/29 14:49:42 robert Exp $

Index: third_party/libsync/src/sync.c
--- third_party/libsync/src/sync.c.orig
+++ third_party/libsync/src/sync.c
@@ -17,7 +17,9 @@
  */
 
 #include <fcntl.h>
+#if !defined(__OpenBSD__)
 #include <malloc.h>
+#endif
 #include <stdint.h>
 #include <string.h>
 #include <errno.h>
@@ -29,6 +31,12 @@
 
 #include <sync/sync.h>
 
+#if defined(__OpenBSD__)
+typedef __uint8_t __u8;
+typedef __uint32_t __u32;
+typedef __int32_t __s32;
+#define ETIME ETIMEDOUT
+#endif
 
 struct sw_sync_create_fence_data {
   __u32 value;
