Index: Common/os.h
--- Common/os.h.orig
+++ Common/os.h
@@ -0,0 +1,47 @@
+/* OpenBSD operating-system definitions for sedutil-cli. */
+#pragma once
+
+#include <sys/types.h>
+
+#include <arpa/inet.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "DtaConstants.h"
+#include "log.h"
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define SNPRINTF snprintf
+#define DEVICEEXAMPLE "/dev/rsd0c"
+
+/* These are retained for code which still uses the legacy scan macros. */
+#define DEVICEMASK snprintf(devname, 23, "/dev/rsd%dc", i)
+#define DEVICEMASKN snprintf(devname, 23, "/dev/rsd%dc", j)
+
+#define __unimplemented__ { throw __PRETTY_FUNCTION__; }
+
+static inline void
+osmsSleep(uint32_t milliseconds)
+{
+	(void)usleep(milliseconds * 1000);
+}
+
+typedef void *OSDEVICEHANDLE;
+#define INVALID_HANDLE_VALUE (reinterpret_cast<OSDEVICEHANDLE>(-1))
+
+#define handle(descriptor) \
+	(reinterpret_cast<OSDEVICEHANDLE>(static_cast<uintptr_t>(descriptor)))
+#define handleDescriptor(value) \
+	(static_cast<int>(static_cast<unsigned int>( \
+	    reinterpret_cast<uintptr_t>(value))))
