[PATCH v05 43/72] include/uapi/linux/btrfs.h: define NULL
From: Mikko Rapeli
Date: Mon Aug 22 2016 - 14:40:05 EST
Copied the NULL definition from include/linux/stddef.h which does not have
it in userspace.
Fixes userspace compilation error:
error: âNULLâ undeclared (first use in this function)
return NULL;
Signed-off-by: Mikko Rapeli <mikko.rapeli@xxxxxx>
---
include/uapi/linux/btrfs.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index ac5eacd..8865985 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -20,6 +20,12 @@
#define _UAPI_LINUX_BTRFS_H
#include <linux/types.h>
#include <linux/ioctl.h>
+#include <linux/stddef.h>
+
+/* for userspace where linux/stddef.h doesn't define this */
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_VOL_NAME_MAX 255
--
2.8.1