1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/uClibc/20080801/100-ifaddrs.patch Mon Jan 05 20:37:03 2009 +0000
1.3 @@ -0,0 +1,190 @@
1.4 +Copyright 2008 Yann E. MORIN.
1.5 +
1.6 +This patch is needed to make gcc-4.3.1 able to build the Java frontend.
1.7 +
1.8 +Index: uClibc/libc/inet/ifaddrs.c
1.9 +===================================================================
1.10 +--- uClibc/libc/inet/ifaddrs.c (revision 23002)
1.11 ++++ uClibc/libc/inet/ifaddrs.c (working copy)
1.12 +@@ -22,7 +22,7 @@
1.13 + #include <alloca.h>
1.14 + #include <assert.h>
1.15 + #include <errno.h>
1.16 +-#include "ifaddrs.h"
1.17 ++#include <ifaddrs.h>
1.18 + #include <net/if.h>
1.19 + #include <netinet/in.h>
1.20 + #include <netpacket/packet.h>
1.21 +Index: uClibc/libc/inet/ifaddrs.h
1.22 +===================================================================
1.23 +--- uClibc/libc/inet/ifaddrs.h (revision 23002)
1.24 ++++ uClibc/libc/inet/ifaddrs.h (working copy)
1.25 +@@ -1,76 +0,0 @@
1.26 +-/* ifaddrs.h -- declarations for getting network interface addresses
1.27 +- Copyright (C) 2002 Free Software Foundation, Inc.
1.28 +- This file is part of the GNU C Library.
1.29 +-
1.30 +- The GNU C Library is free software; you can redistribute it and/or
1.31 +- modify it under the terms of the GNU Lesser General Public
1.32 +- License as published by the Free Software Foundation; either
1.33 +- version 2.1 of the License, or (at your option) any later version.
1.34 +-
1.35 +- The GNU C Library is distributed in the hope that it will be useful,
1.36 +- but WITHOUT ANY WARRANTY; without even the implied warranty of
1.37 +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.38 +- Lesser General Public License for more details.
1.39 +-
1.40 +- You should have received a copy of the GNU Lesser General Public
1.41 +- License along with the GNU C Library; if not, write to the Free
1.42 +- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1.43 +- 02111-1307 USA. */
1.44 +-
1.45 +-#ifndef _IFADDRS_H
1.46 +-#define _IFADDRS_H 1
1.47 +-
1.48 +-#include <features.h>
1.49 +-#include <sys/socket.h>
1.50 +-#include <stdbool.h>
1.51 +-#include <stdint.h>
1.52 +-
1.53 +-__BEGIN_DECLS
1.54 +-
1.55 +-/* The `getifaddrs' function generates a linked list of these structures.
1.56 +- Each element of the list describes one network interface. */
1.57 +-struct ifaddrs
1.58 +-{
1.59 +- struct ifaddrs *ifa_next; /* Pointer to the next structure. */
1.60 +-
1.61 +- char *ifa_name; /* Name of this network interface. */
1.62 +- unsigned int ifa_flags; /* Flags as from SIOCGIFFLAGS ioctl. */
1.63 +-
1.64 +- struct sockaddr *ifa_addr; /* Network address of this interface. */
1.65 +- struct sockaddr *ifa_netmask; /* Netmask of this interface. */
1.66 +- union
1.67 +- {
1.68 +- /* At most one of the following two is valid. If the IFF_BROADCAST
1.69 +- bit is set in `ifa_flags', then `ifa_broadaddr' is valid. If the
1.70 +- IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
1.71 +- It is never the case that both these bits are set at once. */
1.72 +- struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
1.73 +- struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
1.74 +- } ifa_ifu;
1.75 +- /* These very same macros are defined by <net/if.h> for `struct ifaddr'.
1.76 +- So if they are defined already, the existing definitions will be fine. */
1.77 +-# ifndef ifa_broadaddr
1.78 +-# define ifa_broadaddr ifa_ifu.ifu_broadaddr
1.79 +-# endif
1.80 +-# ifndef ifa_dstaddr
1.81 +-# define ifa_dstaddr ifa_ifu.ifu_dstaddr
1.82 +-# endif
1.83 +-
1.84 +- void *ifa_data; /* Address-specific data (may be unused). */
1.85 +-};
1.86 +-
1.87 +-
1.88 +-/* Create a linked list of `struct ifaddrs' structures, one for each
1.89 +- network interface on the host machine. If successful, store the
1.90 +- list in *IFAP and return 0. On errors, return -1 and set `errno'.
1.91 +-
1.92 +- The storage returned in *IFAP is allocated dynamically and can
1.93 +- only be properly freed by passing it to `freeifaddrs'. */
1.94 +-extern int getifaddrs (struct ifaddrs **__ifap) __THROW;
1.95 +-
1.96 +-/* Reclaim the storage allocated by a previous `getifaddrs' call. */
1.97 +-extern void freeifaddrs (struct ifaddrs *__ifa) __THROW;
1.98 +-
1.99 +-__END_DECLS
1.100 +-
1.101 +-#endif /* ifaddrs.h */
1.102 +Index: uClibc/libc/inet/getaddrinfo.c
1.103 +===================================================================
1.104 +--- uClibc/libc/inet/getaddrinfo.c (revision 23002)
1.105 ++++ uClibc/libc/inet/getaddrinfo.c (working copy)
1.106 +@@ -68,7 +68,7 @@
1.107 + #include <sys/un.h>
1.108 + #include <sys/utsname.h>
1.109 + #include <net/if.h>
1.110 +-#include "ifaddrs.h"
1.111 ++#include <ifaddrs.h>
1.112 +
1.113 + /* Experimentally off - libc_hidden_proto(memcpy) */
1.114 + /* Experimentally off - libc_hidden_proto(memset) */
1.115 +--- /dev/null 2008-08-04 09:44:45.624322752 +0200
1.116 ++++ uClibc/include/ifaddrs.h 2008-08-05 09:31:20.000000000 +0200
1.117 +@@ -0,0 +1,76 @@
1.118 ++/* ifaddrs.h -- declarations for getting network interface addresses
1.119 ++ Copyright (C) 2002 Free Software Foundation, Inc.
1.120 ++ This file is part of the GNU C Library.
1.121 ++
1.122 ++ The GNU C Library is free software; you can redistribute it and/or
1.123 ++ modify it under the terms of the GNU Lesser General Public
1.124 ++ License as published by the Free Software Foundation; either
1.125 ++ version 2.1 of the License, or (at your option) any later version.
1.126 ++
1.127 ++ The GNU C Library is distributed in the hope that it will be useful,
1.128 ++ but WITHOUT ANY WARRANTY; without even the implied warranty of
1.129 ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.130 ++ Lesser General Public License for more details.
1.131 ++
1.132 ++ You should have received a copy of the GNU Lesser General Public
1.133 ++ License along with the GNU C Library; if not, write to the Free
1.134 ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1.135 ++ 02111-1307 USA. */
1.136 ++
1.137 ++#ifndef _IFADDRS_H
1.138 ++#define _IFADDRS_H 1
1.139 ++
1.140 ++#include <features.h>
1.141 ++#include <sys/socket.h>
1.142 ++#include <stdbool.h>
1.143 ++#include <stdint.h>
1.144 ++
1.145 ++__BEGIN_DECLS
1.146 ++
1.147 ++/* The `getifaddrs' function generates a linked list of these structures.
1.148 ++ Each element of the list describes one network interface. */
1.149 ++struct ifaddrs
1.150 ++{
1.151 ++ struct ifaddrs *ifa_next; /* Pointer to the next structure. */
1.152 ++
1.153 ++ char *ifa_name; /* Name of this network interface. */
1.154 ++ unsigned int ifa_flags; /* Flags as from SIOCGIFFLAGS ioctl. */
1.155 ++
1.156 ++ struct sockaddr *ifa_addr; /* Network address of this interface. */
1.157 ++ struct sockaddr *ifa_netmask; /* Netmask of this interface. */
1.158 ++ union
1.159 ++ {
1.160 ++ /* At most one of the following two is valid. If the IFF_BROADCAST
1.161 ++ bit is set in `ifa_flags', then `ifa_broadaddr' is valid. If the
1.162 ++ IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
1.163 ++ It is never the case that both these bits are set at once. */
1.164 ++ struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
1.165 ++ struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
1.166 ++ } ifa_ifu;
1.167 ++ /* These very same macros are defined by <net/if.h> for `struct ifaddr'.
1.168 ++ So if they are defined already, the existing definitions will be fine. */
1.169 ++# ifndef ifa_broadaddr
1.170 ++# define ifa_broadaddr ifa_ifu.ifu_broadaddr
1.171 ++# endif
1.172 ++# ifndef ifa_dstaddr
1.173 ++# define ifa_dstaddr ifa_ifu.ifu_dstaddr
1.174 ++# endif
1.175 ++
1.176 ++ void *ifa_data; /* Address-specific data (may be unused). */
1.177 ++};
1.178 ++
1.179 ++
1.180 ++/* Create a linked list of `struct ifaddrs' structures, one for each
1.181 ++ network interface on the host machine. If successful, store the
1.182 ++ list in *IFAP and return 0. On errors, return -1 and set `errno'.
1.183 ++
1.184 ++ The storage returned in *IFAP is allocated dynamically and can
1.185 ++ only be properly freed by passing it to `freeifaddrs'. */
1.186 ++extern int getifaddrs (struct ifaddrs **__ifap) __THROW;
1.187 ++
1.188 ++/* Reclaim the storage allocated by a previous `getifaddrs' call. */
1.189 ++extern void freeifaddrs (struct ifaddrs *__ifa) __THROW;
1.190 ++
1.191 ++__END_DECLS
1.192 ++
1.193 ++#endif /* ifaddrs.h */