2002-07-25 00:56:44 +02:00
|
|
|
/* getifaddrs -- get names and addresses of all network interfaces
|
2017-01-01 01:14:16 +01:00
|
|
|
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
2002-07-25 00:56:44 +02:00
|
|
|
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
|
2012-02-10 00:18:22 +01:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2002-07-25 00:56:44 +02:00
|
|
|
|
|
|
|
#include <ifaddrs.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
/* Create a linked list of `struct ifaddrs' structures, one for each
|
|
|
|
network interface on the host machine. If successful, store the
|
|
|
|
list in *IFAP and return 0. On errors, return -1 and set `errno'. */
|
|
|
|
int
|
2014-12-03 00:11:09 +01:00
|
|
|
__getifaddrs (struct ifaddrs **ifap)
|
2002-07-25 00:56:44 +02:00
|
|
|
{
|
|
|
|
__set_errno (ENOSYS);
|
|
|
|
return -1;
|
|
|
|
}
|
2014-12-03 00:11:09 +01:00
|
|
|
weak_alias (__getifaddrs, getifaddrs)
|
2017-09-28 00:19:18 +02:00
|
|
|
libc_hidden_def (__getifaddrs)
|
2014-12-03 00:11:09 +01:00
|
|
|
libc_hidden_weak (getifaddrs)
|
2002-07-25 00:56:44 +02:00
|
|
|
stub_warning (getifaddrs)
|
|
|
|
|
|
|
|
void
|
2014-12-03 00:11:09 +01:00
|
|
|
__freeifaddrs (struct ifaddrs *ifa)
|
2002-07-25 00:56:44 +02:00
|
|
|
{
|
|
|
|
if (ifa == NULL)
|
|
|
|
return; /* a la free, why not? */
|
|
|
|
|
|
|
|
/* Can't be called properly if getifaddrs never succeeded. */
|
|
|
|
abort ();
|
|
|
|
}
|
2014-12-03 00:11:09 +01:00
|
|
|
weak_alias (__freeifaddrs, freeifaddrs)
|
2017-09-28 00:19:18 +02:00
|
|
|
libc_hidden_def (__freeifaddrs)
|
2014-12-03 00:11:09 +01:00
|
|
|
libc_hidden_weak (freeifaddrs)
|
2002-07-25 00:56:44 +02:00
|
|
|
stub_warning (freeifaddrs)
|