Thread (1 message) 1 message, 1 author, 2015-10-15

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

flat view
DORMANTno replies SUPERSEDED

From: Mikko Rapeli <hidden>
Date: 2015-10-15 06:03:25
Also in: lkml
Subsystem: networking [sockets], the rest · Maintainers: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn, Linus Torvalds

Status: Superseded by v05 (posted 2016-08-22). [go to v05]

Revision v4 (3 revisions archived).

Revisions (3)
  1. v03
  2. v4 current [diff against previous]
  3. v05 [diff against previous]
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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help