about summary refs log tree commit diff
path: root/include/string.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-05-22 17:09:36 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-05-22 17:09:36 +0000
commitcf06a4e3579d834c3330184c4ff127c98bc00fcc (patch)
tree8021cc34ee92db51ed9075a719e517a0a79458b3 /include/string.h
parent7348824c39c45d401f62f724ecad4e3479180578 (diff)
downloadglibc-cf06a4e3579d834c3330184c4ff127c98bc00fcc.tar.gz
glibc-cf06a4e3579d834c3330184c4ff127c98bc00fcc.tar.xz
glibc-cf06a4e3579d834c3330184c4ff127c98bc00fcc.zip
Fix pathconf basename namespace (bug 18444).
pathconf (sysdeps/unix/sysv/linux/pathconf.c) uses basename.  But
pathconf is in POSIX back to 1990 while basename is only reserved with
external linkage in those standards including XPG functions.  This
patch fixes this namespace issue in the usual way, renaming basename
to __basename and making it into a weak alias.

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

	[BZ #18444]
	* string/basename.c (basename): Rename to __basename and define as
	weak alias of __basename.  Use libc_hidden_weak.
	* include/string.h (__basename): Declare.  Use libc_hidden_proto.
	* sysdeps/unix/sysv/linux/pathconf.c (distinguish_extX): Call
	__basename instead of basename.
	* conform/Makefile (test-xfail-POSIX2008/unistd.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
Diffstat (limited to 'include/string.h')
-rw-r--r--include/string.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h
index 034e2953df..89f00fda4e 100644
--- a/include/string.h
+++ b/include/string.h
@@ -82,6 +82,8 @@ libc_hidden_proto (__strndup)
 libc_hidden_proto (__strerror_r)
 libc_hidden_proto (__strverscmp)
 libc_hidden_proto (basename)
+extern char *__basename (const char *__filename) __THROW __nonnull ((1));
+libc_hidden_proto (__basename)
 libc_hidden_proto (strcoll)
 libc_hidden_proto (__strcoll_l)
 libc_hidden_proto (__strxfrm_l)