Message ID | 1450048348-1536-1-git-send-email-aurelien@aurel32.net |
---|---|
State | New |
Headers | show |
Aurelien Jarno <aurelien@aurel32.net> writes: > diff --git a/include/ifaddrs.h b/include/ifaddrs.h > index 2787f21..7c52ccf 100644 > --- a/include/ifaddrs.h > +++ b/include/ifaddrs.h > @@ -3,7 +3,9 @@ > #include <stdbool.h> > #include <stdint.h> > > +extern __typeof(getifaddrs) __getifaddrs; > libc_hidden_proto (getifaddrs) > +extern __typeof(freeifaddrs) __freeifaddrs; > libc_hidden_proto (freeifaddrs) You need the hidden_proto on the __ names. Andreas.
On 2015-12-14 09:58, Andreas Schwab wrote: > Aurelien Jarno <aurelien@aurel32.net> writes: > > > diff --git a/include/ifaddrs.h b/include/ifaddrs.h > > index 2787f21..7c52ccf 100644 > > --- a/include/ifaddrs.h > > +++ b/include/ifaddrs.h > > @@ -3,7 +3,9 @@ > > #include <stdbool.h> > > #include <stdint.h> > > > > +extern __typeof(getifaddrs) __getifaddrs; > > libc_hidden_proto (getifaddrs) > > +extern __typeof(freeifaddrs) __freeifaddrs; > > libc_hidden_proto (freeifaddrs) > > You need the hidden_proto on the __ names. If I understand correctly doing so also means adding a hidden_def on the __ names in ifaddrs.c. Is it correct?
On 19 Dec 2015 00:29, Aurelien Jarno wrote: > On 2015-12-14 09:58, Andreas Schwab wrote: > > Aurelien Jarno <aurelien@aurel32.net> writes: > > > --- a/include/ifaddrs.h > > > +++ b/include/ifaddrs.h > > > @@ -3,7 +3,9 @@ > > > #include <stdbool.h> > > > #include <stdint.h> > > > > > > +extern __typeof(getifaddrs) __getifaddrs; > > > libc_hidden_proto (getifaddrs) > > > +extern __typeof(freeifaddrs) __freeifaddrs; > > > libc_hidden_proto (freeifaddrs) > > > > You need the hidden_proto on the __ names. > > If I understand correctly doing so also means adding a hidden_def on > the __ names in ifaddrs.c. Is it correct? yep -mike
diff --git a/ChangeLog b/ChangeLog index 13be8a8..3fb0b90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-12-12 Aurelien Jarno <aurelien@aurel32.net> + + * include/ifaddrs.h (__getifaddrs): Declare. + (__freeifaddrs): Declare. + * inet/check_pf.c (__check_pf): Call __getifaddrs instead of + getifaddrs. Call __freeifaddrs instead of freeifaddrs. + * nscd/gai.c (__getifaddrs): Define to getifaddrs. + (__freeifaddrs): define to freeifaddrs. + 2015-12-11 Aurelien Jarno <aurelien@aurel32.net> * sysdeps/unix/sysv/linux/arm/ioperm.c: Do not include diff --git a/include/ifaddrs.h b/include/ifaddrs.h index 2787f21..7c52ccf 100644 --- a/include/ifaddrs.h +++ b/include/ifaddrs.h @@ -3,7 +3,9 @@ #include <stdbool.h> #include <stdint.h> +extern __typeof(getifaddrs) __getifaddrs; libc_hidden_proto (getifaddrs) +extern __typeof(freeifaddrs) __freeifaddrs; libc_hidden_proto (freeifaddrs) struct in6addrinfo diff --git a/inet/check_pf.c b/inet/check_pf.c index 3739a95..c49d6b5 100644 --- a/inet/check_pf.c +++ b/inet/check_pf.c @@ -32,7 +32,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6, /* Get the interface list via getifaddrs. */ struct ifaddrs *ifa = NULL; - if (getifaddrs (&ifa) != 0) + if (__getifaddrs (&ifa) != 0) { /* We cannot determine what interfaces are available. Be pessimistic. */ @@ -51,7 +51,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6, else if (runp->ifa_addr->sa_family == PF_INET6) *seen_ipv6 = true; - (void) freeifaddrs (ifa); + (void) __freeifaddrs (ifa); } diff --git a/nscd/gai.c b/nscd/gai.c index 9a52a97..dc289d6 100644 --- a/nscd/gai.c +++ b/nscd/gai.c @@ -29,6 +29,8 @@ #define __strchrnul strchrnul #define __getline getline #define __qsort_r qsort_r +#define __getifaddrs getifaddrs +#define __freeifaddrs freeifaddrs /* nscd uses 1MB or 2MB thread stacks. */ #define __libc_use_alloca(size) (size <= __MAX_ALLOCA_CUTOFF)