[PATCH v4 37/79] include/uapi/linux/socket.h: include sys/socket.h in userspace

From: Mikko Rapeli
Date: Thu Oct 15 2015 - 02:03:27 EST


This libc header has sockaddr definition for userspace.

Fixes userspace compilation errors like these from kernel headers including
only linux/socket.h:

error: field âifru_addrâ has incomplete type
struct sockaddr ifru_addr;

Signed-off-by: Mikko Rapeli <mikko.rapeli@xxxxxx>
---
include/uapi/linux/socket.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h
index 76ab0c6..8a81197 100644
--- a/include/uapi/linux/socket.h
+++ b/include/uapi/linux/socket.h
@@ -1,6 +1,10 @@
#ifndef _UAPI_LINUX_SOCKET_H
#define _UAPI_LINUX_SOCKET_H

+#ifndef __KERNEL__
+#include <sys/socket.h>
+#endif
+
/*
* Desired design of maximum size and alignment (see RFC2553)
*/
--
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/