Commit Graph

11 Commits

Author SHA1 Message Date
Joseph Myers 9a44d530c4 Fix resolver if_* namespace (bug 17717).
Resolver code, brought in by pthreads (at least), uses if_* interfaces
that weren't in POSIX before 2001, resulting in linknamespace
failures.  This patch changes those interfaces to be weak aliases of
__if_* and makes the resolver use __if_* directly.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17717]
	* inet/if_index.c (if_nametoindex): Rename to __if_nametoindex and
	define as weak alias of __if_nametoindex.  Use libc_hidden_weak.
	(if_indextoname): Rename to __if_indextoname and define as weak
	alias of __if_indextoname.  Use libc_hidden_weak.
	(if_freenameindex): Rename to __if_freenameindex and define as
	weak alias of __if_freenameindex.
	(if_nameindex): Rename to __if_nameindex and define as weak alias
	of __if_nameindex.
	* sysdeps/mach/hurd/if_index.c (if_nametoindex): Rename to
	__if_nametoindex and define as weak alias of __if_nametoindex.
	Use libc_hidden_weak.
	(if_freenameindex): Rename to __if_freenameindex and define as
	weak alias of __if_freenameindex.
	(if_nameindex): Rename to __if_nameindex and define as weak alias
	of __if_nameindex.
	(if_indextoname): Rename to __if_indextoname and define as weak
	alias of __if_indextoname.  Use libc_hidden_weak.
	* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Rename to
	__if_nametoindex and define as weak alias of __if_nametoindex.
	Use libc_hidden_weak.
	(if_freenameindex): Rename to __if_freenameindex and define as
	weak alias of __if_freenameindex.  Use libc_hidden_weak.
	(if_nameindex_netlink): Use __if_freenameindex instead of
	if_freenameindex.
	(if_nameindex): Rename to __if_nameindex and define as weak alias
	of __if_nameindex.  Use libc_hidden_weak.
	(if_indextoname): Rename to __if_indextoname and define as weak
	alias of __if_indextoname.  Use libc_hidden_weak.
	* include/net/if.h [!_ISOMAC] (__if_nametoindex): Declare and use
	libc_hidden_proto.
	[!_ISOMAC] (__if_freenameindex): Likewise.
	* resolv/res_init.c (__res_vinit): Use __if_nametoindex instead of
	if_nametoindex.
	* conform/Makefile (test-xfail-XPG4/grp.h/linknamespace): Remove
	variable.
	(test-xfail-XPG4/pwd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/aio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/grp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pthread.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pwd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sched.h/linknamespace): Likewise.
	(test-xfail-UNIX98/time.h/linknamespace): Likewise.
2014-12-16 18:18:49 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Ulrich Drepper 72e6cdfa2c Remove useless "if" before "free". 2008-03-19 06:43:34 +00:00
Roland McGrath faea9de6e0 * include/sys/wait.h (__waitpid): Add libc_hidden_proto.
* sysdeps/unix/sysv/sco3.2.4/waitpid.S: Add libc_hidden_def.
	* sysdeps/unix/sysv/sysv4/waitpid.c: Add libc_hidden_weak.
	* sysdeps/unix/sysv/linux/waitpid.c: Likewise.
	* sysdeps/unix/sysv/aix/waitpid.c: Likewise.
	* sysdeps/unix/bsd/bsd4.4/waitpid.c: Likewise.
	* sysdeps/generic/waitpid.c: Likewise.

	* include/net/if.h: New file.  Use libc_hidden_proto
	for if_nametoindex and if_indextoname.
	* sysdeps/generic/if_index.c: Add libc_hidden_def.
	* sysdeps/mach/hurd/if_index.c: Likewise.
	* sysdeps/unix/sysv/linux/if_index.c: Likewise.

	* include/grp.h (setgroups): Add libc_hidden_proto.
	* sysdeps/generic/setgroups.c: Add libc_hidden_def.
	* sysdeps/mach/hurd/setgroups.c: Likewise.
	* sysdeps/unix/sysv/irix4/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
2002-08-13 01:08:15 +00:00
Roland McGrath b83cbb99bd * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start: go): Fix arg type.
* sysdeps/mach/hurd/if_index.c (if_nameindex): Use size_t for AMOUNT
	argument to pfinet_siocgifconf RPC.
2002-06-13 09:02:29 +00:00
Andreas Jaeger 41bdb6e20c Update to LGPL v2.1.
2001-07-06  Paul Eggert  <eggert@twinsun.com>

	* manual/argp.texi: Remove ignored LGPL copyright notice; it's
	not appropriate for documentation anyway.
	* manual/libc-texinfo.sh: "Library General Public License" ->
	"Lesser General Public License".

2001-07-06  Andreas Jaeger  <aj@suse.de>

	* All files under GPL/LGPL version 2: Place under LGPL version
	2.1.
2001-07-06 04:58:11 +00:00
Mark Kettenis 5bd5e35748 * sysdeps/mach/hurd/if_index.c: Redone to use new interfaces in the Hurd pfinet server, using equivalent code from the Linux version in sysdeps/unix/sysv/linux/if_index.c. In detail: Include <unistd.h>, <error.h>, <sys/ioctl.h>, <hurd/ioctl.h> and <hurd/pfinet.h>. Don't include <sys/mman.h> and <hurd/fsys.h> anymore. (if_nametoindex): New implementation using SIOCGIFINDEX. (if_freenameindex): Straight copy of the Linux version. (if_nameindex): New implementation based on pfinet_siocgifconf and SIOCGIFINDEX. (if_indextoname): New implementation using SIOCGIFNAME. (map_interfaces): Function removed. From Marcus Brinkmann <marcus@gnu.org>.
2001-07-01  Mark Kettenis  <kettenis@gnu.org>

	* sysdeps/mach/hurd/if_index.c: Redone to use new interfaces in
	the Hurd pfinet server, using equivalent code from the Linux
	version in sysdeps/unix/sysv/linux/if_index.c. In detail:
	Include <unistd.h>, <error.h>, <sys/ioctl.h>, <hurd/ioctl.h> and
	<hurd/pfinet.h>.  Don't include <sys/mman.h> and <hurd/fsys.h>
	anymore.
	(if_nametoindex): New implementation using SIOCGIFINDEX.
	(if_freenameindex): Straight copy of the Linux version.
	(if_nameindex): New implementation based on pfinet_siocgifconf and
	SIOCGIFINDEX.
	(if_indextoname): New implementation using SIOCGIFNAME.
	(map_interfaces): Function removed.
	From Marcus Brinkmann <marcus@gnu.org>.
2001-07-01 12:06:11 +00:00
Andreas Jaeger 90c00a4c96 (__protocol_available): Uncomment, it's not needed at the moment. 2000-12-27 08:14:22 +00:00
Roland McGrath 4f173e2c8a * sysdeps/mach/hurd/if_index.c: New file.
* sysdeps/unix/sysv/linux/net/if.h: Moved to ...
	* sysdeps/gnu/net/if.h: here.
	(_IOT_ifconf, _IOT_ifreq): Hurd ioctl type macros moved from ...
	* sysdeps/mach/hurd/net/if.h: ... here; this file now removed.
	* sysdeps/generic/net/if.h: New file.  Declares just the standard
	functions and `struct if_nameindex' type.
	* socket/Makefile (headers): Add net/if.h here.
	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Not here.
	* sysdeps/mach/hurd/Dist: Remove it here.
	* sysdeps/unix/sysv/linux/Dist: And here.
	* sysdeps/generic/if_index.c: Include <net/if.h>.
2000-03-24 20:59:00 +00:00