aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi/recipes-core-ivi/eglibc/eglibc/eglibc_2.18_add_af_bus_support.patch
blob: 48e8f5c8eafd1ed796295d97a001818e02c2396a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
Index: libc/Makefile
===================================================================
--- libc.orig/Makefile
+++ libc/Makefile
@@ -317,7 +317,7 @@ installed-headers = argp/argp.h assert/a
 		    resource/sys/vtimes.h resource/ulimit.h rt/aio.h \
 		    rt/mqueue.h setjmp/setjmp.h shadow/shadow.h \
 		    signal/signal.h signal/sys/signal.h socket/sys/socket.h \
-		    socket/sys/un.h stdio-common/printf.h \
+		    socket/sys/un.h socket/sys/bus.h stdio-common/printf.h \
 		    stdio-common/stdio_ext.h stdlib/stdlib.h stdlib/alloca.h \
 		    stdlib/monetary.h stdlib/fmtmsg.h stdlib/ucontext.h \
 		    sysdeps/generic/inttypes.h sysdeps/generic/stdint.h \
Index: libc/include/sys/bus.h
===================================================================
--- /dev/null
+++ libc/include/sys/bus.h
@@ -0,0 +1 @@
+#include <socket/sys/bus.h>
Index: libc/socket/Makefile
===================================================================
--- libc.orig/socket/Makefile
+++ libc/socket/Makefile
@@ -21,7 +21,7 @@
 #
 subdir	:= socket
 
-headers	:= sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \
+headers	:= sys/socket.h sys/bus.h sys/un.h bits/sockaddr.h bits/socket.h \
 	   bits/socket2.h sys/socketvar.h net/if.h
 
 routines := accept bind connect getpeername getsockname getsockopt	\
Index: libc/socket/sys/bus.h
===================================================================
--- /dev/null
+++ libc/socket/sys/bus.h
@@ -0,0 +1,57 @@
+/* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_BUS_H
+#define _SYS_BUS_H      1
+
+#include <sys/cdefs.h>
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+/* 'protocol' to use in socket(AF_BUS, SOCK_SEQPACKET, protocol) */
+#define BUS_PROTO_NONE  0
+#define BUS_PROTO_DBUS  1
+#define BUS_PROTO_MAX   1
+
+/* setsockopt() operations */
+#define SOL_BUS         280
+#define BUS_ADD_ADDR        1
+#define BUS_JOIN_BUS        2
+#define BUS_DEL_ADDR        3
+#define BUS_SET_EAVESDROP   4
+#define BUS_UNSET_EAVESDROP 5
+
+/* Bus address */
+struct bus_addr
+  {
+    __uint64_t s_addr; /* 16-bit prefix + 48-bit client address */
+  };
+
+/* Structure describing an AF_BUS socket address. */
+struct sockaddr_bus
+  {
+    __SOCKADDR_COMMON (sbus_);    /* AF_BUS */
+    struct bus_addr    sbus_addr; /* bus address */
+    char sbus_path[108];          /* pathname */
+  };
+
+__END_DECLS
+
+#endif /* sys/bus.h */
Index: libc/socket/sys/socket.h
===================================================================
--- libc.orig/socket/sys/socket.h
+++ libc/socket/sys/socket.h
@@ -86,7 +86,8 @@ enum
   __SOCKADDR_ONETYPE (sockaddr_iso) \
   __SOCKADDR_ONETYPE (sockaddr_ns) \
   __SOCKADDR_ONETYPE (sockaddr_un) \
-  __SOCKADDR_ONETYPE (sockaddr_x25)
+  __SOCKADDR_ONETYPE (sockaddr_x25) \
+  __SOCKADDR_ONETYPE (sockaddr_bus)
 
 # define __SOCKADDR_ONETYPE(type) struct type *__restrict __##type##__;
 typedef union { __SOCKADDR_ALLTYPES
Index: libc/sysdeps/unix/sysv/linux/bits/socket.h
===================================================================
--- libc.orig/sysdeps/unix/sysv/linux/bits/socket.h
+++ libc/sysdeps/unix/sysv/linux/bits/socket.h
@@ -80,7 +80,8 @@
 #define PF_ALG		38	/* Algorithm sockets.  */
 #define PF_NFC		39	/* NFC sockets.  */
 #define PF_VSOCK	40	/* vSockets.  */
-#define	PF_MAX		41	/* For now..  */
+#define PF_BUS		41	/* AF_BUS sockets */
+#define	PF_MAX		42	/* For now..  */
 
 /* Address families.  */
 #define	AF_UNSPEC	PF_UNSPEC
@@ -125,6 +126,7 @@
 #define AF_ALG		PF_ALG
 #define AF_NFC		PF_NFC
 #define AF_VSOCK	PF_VSOCK
+#define AF_BUS		PF_BUS
 #define	AF_MAX		PF_MAX
 
 /* Socket level values.  Others are defined in the appropriate headers.