netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* include/linux/netlink.h: problem when included by an application
@ 2011-08-05 21:45 Michel Machado
  2011-08-07  1:15 ` Ben Hutchings
  0 siblings, 1 reply; 24+ messages in thread
From: Michel Machado @ 2011-08-05 21:45 UTC (permalink / raw)
  To: netdev

Hi there,

   When an application includes header <linux/netlink.h> obtained with
'make headers_install' or from /usr/include/, it produces the following
error:

/usr/include/linux/netlink.h:31:2: error: expected
specifier-qualifier-list before ‘sa_family_t’

   The error doesn't come up in the kernel because
include/linux/netlink.h has the following line:

#include <linux/socket.h> /* for sa_family_t */

   However, <linux/socket.h> from /usr/include/ doesn't have sa_family_t
because it's protected by an $ifdef __KERNEL__ in
include/linux/socket.h.

   A workaround for an application is to include <sys/socket.h> before
<linux/netlink.h>. However, shouldn't include/linux/netlink.h be fixed?

   The simplest solution that I came up was replacing sa_family_t in
include/linux/netlink.h to 'unsigned short' as header
include/linux/socket.h does for struct __kernel_sockaddr_storage
available to applications.

-- 
[ ]'s
Michel Machado




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

end of thread, other threads:[~2011-08-09 15:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-05 21:45 include/linux/netlink.h: problem when included by an application Michel Machado
2011-08-07  1:15 ` Ben Hutchings
2011-08-07 22:14   ` Michel Machado
2011-08-08  5:48     ` David Miller
2011-08-08 13:15       ` [PATCH 00/12] Fix net header dependencies Ben Hutchings
2011-08-08 13:16         ` [PATCH 01/12] headers, pppox: Add missing #include to <linux/if_pppox.h> Ben Hutchings
2011-08-08 13:17         ` [PATCH 02/12] headers, ax25: Add missing #include to <linux/netrom.h>, <linux/rose.h> Ben Hutchings
2011-08-08 14:07           ` Ralf Baechle
2011-08-08 13:17         ` [PATCH 03/12] headers, pppol2tp: Use __kernel_pid_t in <linux/pppol2tp.h> Ben Hutchings
2011-08-08 13:18         ` [PATCH 04/12] headers, net: Use __kernel_sa_family_t in more definitions shared with userland Ben Hutchings
2011-08-08 13:18         ` [PATCH 05/12] headers, net: Define struct __kernel_sockaddr, replacing struct sockaddr Ben Hutchings
2011-08-08 13:19         ` [PATCH 06/12] headers, netfilter: Use kernel type names __u8, __u16, __u32 Ben Hutchings
2011-08-08 13:19         ` [PATCH 07/12] headers, tipc: Add missing #include to <linux/tipc_config.h> for userland Ben Hutchings
2011-08-08 13:20         ` [PATCH 08/12] headers, netfilter: Add missing #include <limits.h> " Ben Hutchings
2011-08-08 13:20         ` [PATCH 09/12] headers, xtables: Add missing #include <linux/netfilter.h> Ben Hutchings
2011-08-09 15:29           ` Patrick McHardy
2011-08-08 13:20         ` [PATCH 10/12] headers, can: Add missing #include to <linux/can/bcm.h> Ben Hutchings
2011-08-08 15:15           ` Oliver Hartkopp
2011-08-08 13:24         ` [PATCH 11/12] headers, scc: Add missing #include to <linux/scc.h> Ben Hutchings
2011-08-08 18:20           ` Ben Hutchings
2011-08-09  7:14             ` walter harms
2011-08-08 13:25         ` [PATCH 12/12] headers, ppp: Add missing #include to <linux/if_ppp.h> Ben Hutchings
2011-08-09  7:27           ` David Miller
2011-08-09 12:40             ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).