Group :: Development/Kernel
RPM: glibc-kernheaders
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: 0004-uapi-fix-linux-vm_sockets.h-userspace-compilation-er.patch
Download
Download
From c09e19afb7d3ab147e94f7fe6683b525e74dd01d Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Thu, 23 Feb 2017 23:47:00 +0000
Subject: [PATCH 04/21] 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 <ldv@altlinux.org>
---
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 68d57c5e99bc..2dbf39206f68 100644
--- a/include/uapi/linux/vm_sockets.h
+++ b/include/uapi/linux/vm_sockets.h
@@ -141,13 +141,14 @@
* 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;
- 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)];
};