diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2019-09-22 22:29:00 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2019-09-22 22:29:00 +0200 |
| commit | 53c716412708db7000e06292fb89b2609f9a48f7 (patch) | |
| tree | 3ede481ee0926f0e53e14bba61028d307d58296c /include/uapi/linux/socket.h | |
| parent | e6d64ce06c28b615ebfeab7b8bfad6136ea83095 (diff) | |
| parent | aec256d0ecd561036f188dbc8fa7924c47a9edfd (diff) | |
Merge branch 'for-5.4/apple' into for-linus
- stuck 'fn' key fix for hid-apple from Joao Moreno
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 */ |
