diff options
| author | Ingo Molnar <mingo@kernel.org> | 2019-09-03 09:23:41 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2019-09-03 09:23:41 +0200 |
| commit | ae1ad26388228048db6a5f1056bd569ed2bbc4ec (patch) | |
| tree | 223f50677aa00eb6f2a6529099a1005c7e43c071 /include/uapi/linux/socket.h | |
| parent | c84b82dd3e593db217f23c60f7edae02c76a3c4c (diff) | |
| parent | 089cf7f6ecb266b6a4164919a2e69bd2f938374a (diff) | |
Merge tag 'v5.3-rc7' into x86/mm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/uapi/linux/socket.h')
| -rw-r--r-- | include/uapi/linux/socket.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h index 8eb96021709c..c3409c8ec0dd 100644 --- a/include/uapi/linux/socket.h +++ b/include/uapi/linux/socket.h @@ -6,17 +6,24 @@ * Desired design of maximum size and alignment (see RFC2553) */ #define _K_SS_MAXSIZE 128 /* Implementation specific max size */ -#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) - /* Implementation specific desired alignment */ typedef unsigned short __kernel_sa_family_t; +/* + * The definition uses anonymous union and struct in order to control the + * default alignment. + */ struct __kernel_sockaddr_storage { - __kernel_sa_family_t ss_family; /* address family */ - /* Following field(s) are implementation specific */ - char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; + union { + struct { + __kernel_sa_family_t ss_family; /* address family */ + /* Following field(s) are implementation specific */ + char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; /* space to achieve desired size, */ /* _SS_MAXSIZE value minus size of ss_family */ -} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ + }; + void *__align; /* implementation specific desired alignment */ + }; +}; #endif /* _UAPI_LINUX_SOCKET_H */ |
