Thread (3 messages) 3 messages, 3 authors, 2017-08-09
STALE3228d
Revisions (4)
  1. v03 [diff vs current]
  2. v4 [diff vs current]
  3. v05 [diff vs current]
  4. v06 current

[PATCH v06 15/36] uapi linux/socket.h: include sys/socket.h in user space

From: Mikko Rapeli <hidden>
Date: 2017-08-06 17:06:32
Also in: linux-api, lkml
Subsystem: networking [sockets], the rest · Maintainers: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn, Linus Torvalds

This libc header has sockaddr definition in user space.

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

error: field ‘ifru_addr’ has incomplete type
struct sockaddr ifru_addr;
error: field ‘_sockaddr’ has incomplete type
struct sockaddr  _sockaddr;
error: invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’

With this following uapi headers now compile in user space:

rdma/rdma_user_rxe.h
linux/vm_sockets.h
linux/ncp_fs.h
linux/nfc.h
linux/phonet.h

Signed-off-by: Mikko Rapeli <redacted>
Cc: netdev@vger.kernel.org
Cc: Dmitry V. Levin <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 76ab0c68561e..8a81197cc08b 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.13.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help