public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uapi: fix linux/sysctl.h userspace compilation errors
@ 2017-02-22 23:06 Dmitry V. Levin
  2017-02-23  1:34 ` Eric W. Biederman
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry V. Levin @ 2017-02-22 23:06 UTC (permalink / raw)
  To: Alexey Dobriyan, Andrew Morton, Eric W. Biederman; +Cc: linux-kernel

Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
linux/sysctl.h userspace compilation errors:

/usr/include/linux/sysctl.h:38:2: error: unknown type name 'size_t'
  size_t *oldlenp;
/usr/include/linux/sysctl.h:40:2: error: unknown type name 'size_t'
  size_t newlen;

This also fixes userspace compilation of uapi headers that include
linux/sysctl.h, e.g. linux/netfilter.h.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/linux/sysctl.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
index d2b1215..c6d18aa 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -26,6 +26,10 @@
 #include <linux/types.h>
 #include <linux/compiler.h>
 
+#ifndef __KERNEL__
+#include <stddef.h>		/* For size_t. */
+#endif
+
 #define CTL_MAXNAME 10		/* how many path components do we allow in a
 				   call to sysctl?   In other words, what is
 				   the largest acceptable value for the nlen
-- 
ldv

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-23 20:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22 23:06 [PATCH] uapi: fix linux/sysctl.h userspace compilation errors Dmitry V. Levin
2017-02-23  1:34 ` Eric W. Biederman
2017-02-23  2:49   ` [PATCH] uapi: stop including linux/sysctl.h in uapi/linux/netfilter.h Dmitry V. Levin
2017-02-23 20:51     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox