+#ifdef __KERNEL__
+#include_next <linux/types.h>
+#elif defined(HAVE_LINUX_TYPES_H)
+/* With some combinations of kernel and userspace headers, including both
+ * <sys/types.h> and <linux/types.h> only works if you do so in that order, so
+ * force it. */
+
+#ifdef __CHECKER__
+#define __CHECK_ENDIAN__
+#endif
+
+#include <sys/types.h>