summarylogtreecommitdiffstats
path: root/linux_compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux_compat.h')
-rw-r--r--linux_compat.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/linux_compat.h b/linux_compat.h
new file mode 100644
index 000000000000..9ad6ce5b333d
--- /dev/null
+++ b/linux_compat.h
@@ -0,0 +1,29 @@
+#ifndef LINUX_COMPAT_H
+#define LINUX_COMPAT_H
+
+#ifdef __linux__
+
+#define _GNU_SOURCE
+
+#include <stdlib.h>
+#include <errno.h>
+
+extern char *program_invocation_short_name;
+
+#define getprogname() program_invocation_short_name
+
+#define __unreachable() __builtin_unreachable()
+#define __dead2 __attribute__((__noreturn__))
+
+size_t
+strlcat(char *dst, const char *src, size_t siz);
+
+size_t
+strlcpy(char *dst, const char *src, size_t siz);
+
+void errc(int eval, int status, const char *fmt, ...) __dead2;
+
+#define __FBSDID(x)
+
+#endif /* __linux__ */
+#endif /* LINUX_COMPAT_H */