Skip to contentSkip to conversation

fscrypt: include <linux/ioctl.h> in UAPI header

PATCH Applied Eric Biggers 1 participant 2 messages Dec 19, 2019 – Jan 3, 2020

Subsystems (2)
lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 fscrypt: include <linux/ioctl.h> in UAPI header

From: Eric Biggers <[email protected]>

<linux/fscrypt.h> defines ioctl numbers using the macros like _IORW() which are defined in <linux/ioctl.h>, so <linux/ioctl.h> should be included as a prerequisite, like it is in many other kernel headers.

In practice this doesn't really matter since anyone referencing these ioctl numbers will almost certainly include <sys/ioctl.h> too in order to actually call ioctl(). But we might as well fix this.

---
 include/uapi/linux/fscrypt.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/linux/fscrypt.h +1 -0
index d5112a24e8b9f..0d8a6f47711c3 100644
@@ -8,6 +8,7 @@
 #ifndef _UAPI_LINUX_FSCRYPT_H
 #define _UAPI_LINUX_FSCRYPT_H
 
+#include <linux/ioctl.h>
 #include <linux/types.h>
 
 /* Encryption policy flags */
Signature · 1 line
2.24.1.735.g03f4e72817-goog
author maintainer Applied
#1 lore raw
Quoted 30 lines · Eric Biggers

From: Eric Biggers <[email protected]>

<linux/fscrypt.h> defines ioctl numbers using the macros like _IORW() which are defined in <linux/ioctl.h>, so <linux/ioctl.h> should be included as a prerequisite, like it is in many other kernel headers.

In practice this doesn't really matter since anyone referencing these ioctl numbers will almost certainly include <sys/ioctl.h> too in order to actually call ioctl(). But we might as well fix this.

---
 include/uapi/linux/fscrypt.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/linux/fscrypt.h +1 -0
index d5112a24e8b9f..0d8a6f47711c3 100644
@@ -8,6 +8,7 @@
 #ifndef _UAPI_LINUX_FSCRYPT_H
 #define _UAPI_LINUX_FSCRYPT_H
 
+#include <linux/ioctl.h>
 #include <linux/types.h>
 
 /* Encryption policy flags */
Signature · 1 line
2.24.1.735.g03f4e72817-goog

Applied to fscrypt.git#master for 5.6.

(Fixed a typo in the commit message -- "_IORW()" should be "_IOWR()".)

- Eric