[lkml]   [2017]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v06 15/36] uapi linux/socket.h: include sys/socket.h in user space
On Wed, Aug 9, 2017 at 1:00 AM, Dmitry V. Levin <> wrote:
> On Sun, Aug 06, 2017 at 06:44:06PM +0200, Mikko Rapeli wrote:
>> 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

>> +#ifndef __KERNEL__
>> +#include <sys/socket.h>
>> +#endif
> This is scary because of infamous libc vs uapi interoperability issues.
> Couldn't we fix affected headers instead?

Yes, I think that would be better. Maybe we can introduce a
'struct __kernel_sockaddr' in include/uapi/linux/socket.h to
go along with __kernel_sa_family_t and __kernel_sockaddr_storage,
and then use those types in the other kernel headers?


 \ /
  Last update: 2017-08-09 14:33    [W:0.047 / U:2.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site