diff options
author | Ben Brewer <benbrewer@codethink.co.uk> | 2012-11-27 10:30:31 +0000 |
---|---|---|
committer | Ben Brewer <benbrewer@codethink.co.uk> | 2012-11-27 10:30:31 +0000 |
commit | d1f79cc862c8993191d0d178c5461ce75bbc5d52 (patch) | |
tree | 8dac8825f8b2dbcbb16c10d3f2c7abca323bd0e6 | |
parent | b7557a90d4684c508aa3557f79cc351bd8e6b7d6 (diff) | |
download | eglibc2-baserock/genivi/baseline-af-bus.tar.gz |
Add AF_BUS patch from collaborabaserock/genivi/baseline-af-busbaserock/af-bus
-rw-r--r-- | libc/Makefile | 2 | ||||
-rw-r--r-- | libc/include/sys/bus.h | 1 | ||||
-rw-r--r-- | libc/socket/Makefile | 2 | ||||
-rw-r--r-- | libc/socket/sys/bus.h | 57 | ||||
-rw-r--r-- | libc/socket/sys/socket.h | 3 | ||||
-rw-r--r-- | libc/sysdeps/unix/sysv/linux/bits/socket.h | 5 |
6 files changed, 66 insertions, 4 deletions
diff --git a/libc/Makefile b/libc/Makefile index 9b8501428..55220ab18 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -331,7 +331,7 @@ installed-headers = argp/argp.h assert/assert.h catgets/nl_types.h \ 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 \ diff --git a/libc/include/sys/bus.h b/libc/include/sys/bus.h new file mode 100644 index 000000000..b635566f6 --- /dev/null +++ b/libc/include/sys/bus.h @@ -0,0 +1 @@ +#include <socket/sys/bus.h> diff --git a/libc/socket/Makefile b/libc/socket/Makefile index 0e242b579..0bb0912db 100644 --- a/libc/socket/Makefile +++ b/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 \ diff --git a/libc/socket/sys/bus.h b/libc/socket/sys/bus.h new file mode 100644 index 000000000..f875e1cba --- /dev/null +++ b/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 */ diff --git a/libc/socket/sys/socket.h b/libc/socket/sys/socket.h index 9b1f56f8b..cbb371445 100644 --- a/libc/socket/sys/socket.h +++ b/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 diff --git a/libc/sysdeps/unix/sysv/linux/bits/socket.h b/libc/sysdeps/unix/sysv/linux/bits/socket.h index 69e090bd4..0584d6c20 100644 --- a/libc/sysdeps/unix/sysv/linux/bits/socket.h +++ b/libc/sysdeps/unix/sysv/linux/bits/socket.h @@ -112,7 +112,8 @@ enum __socket_type #define PF_CAIF 37 /* CAIF sockets. */ #define PF_ALG 38 /* Algorithm sockets. */ #define PF_NFC 39 /* NFC sockets. */ -#define PF_MAX 40 /* For now.. */ +#define PF_BUS 40 /* AF_BUS sockets */ +#define PF_MAX 41 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -156,6 +157,8 @@ enum __socket_type #define AF_CAIF PF_CAIF #define AF_ALG PF_ALG #define AF_NFC PF_NFC +#define AF_NFC PF_NFC +#define AF_BUS PF_BUS #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. |