From 1ecdd45531ded556a65733eb8fe545cd0bbd3b8f Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 23 Feb 2017 23:47:00 +0000 Subject: [PATCH 3/6] uapi: fix linux/vm_sockets.h userspace compilation errors Use __kernel_sa_family_t instead of sa_family_t and __SOCK_SIZE__ instead of sizeof(struct sockaddr) the same way as uapi/linux/in.h does, to fix the following linux/vm_sockets.h userspace compilation errors: /usr/include/linux/vm_sockets.h:148:32: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr' unsigned char svm_zero[sizeof(struct sockaddr) - /usr/include/linux/vm_sockets.h:149:18: error: 'sa_family_t' undeclared here (not in a function) sizeof(sa_family_t) - Signed-off-by: Dmitry V. Levin --- include/uapi/linux/vm_sockets.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h index c60ca33eac59..017d12b216df 100644 --- a/include/uapi/linux/vm_sockets.h +++ b/include/uapi/linux/vm_sockets.h @@ -175,14 +175,15 @@ * of this structure should be exactly the same as that of struct sockaddr. */ +#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ struct sockaddr_vm { __kernel_sa_family_t svm_family; unsigned short svm_reserved1; unsigned int svm_port; unsigned int svm_cid; __u8 svm_flags; - unsigned char svm_zero[sizeof(struct sockaddr) - - sizeof(sa_family_t) - + unsigned char svm_zero[__SOCK_SIZE__ - + sizeof(__kernel_sa_family_t) - sizeof(unsigned short) - sizeof(unsigned int) - sizeof(unsigned int) -