aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-02-18 18:47:34 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-02-18 18:47:34 +0000
commit4ffb1771554dd4661beb44be2036c598aa56c80a (patch)
tree28c5450c2dca041865cd73a3b1f90178fd7f20ba /include
parent94c5a52a841f807a23dbdd19a5ddeb505cc1d543 (diff)
downloadglibc-4ffb1771554dd4661beb44be2036c598aa56c80a.tar
glibc-4ffb1771554dd4661beb44be2036c598aa56c80a.tar.gz
glibc-4ffb1771554dd4661beb44be2036c598aa56c80a.tar.bz2
glibc-4ffb1771554dd4661beb44be2036c598aa56c80a.zip
Fix search.h namespace (bug 17996).
The implementation of the (XSI POSIX) functions hsearch / hcreate / hdestroy uses hsearch_r / hcreate_r / hdestroy_r, which are not POSIX functions. This patch makes those into weak aliases for __*_r and uses those names for the calls within libc. Tested for x86_64 that the disassembly of installed shared libraries is unchanged by this patch. [BZ #17996] * include/search.h (hcreate_r): Don't use libc_hidden_proto. (hdestroy_r): Likewise. (hsearch_r): Likewise. (__hcreate_r): Declare and use libc_hidden_proto. (__hdestroy_r): Likewise. (__hsearch_r): Likewise. * misc/hsearch.c (hsearch): Call __hsearch_r instead of hsearch_r. (hcreate): Call __hcreate_r instead of hcreate_r. (__hdestroy): Call __hdestroy_r instead of hdestroy_r. * misc/hsearch_r.c (hcreate_r): Rename to __hcreate_r and define as weak alias of __hcreate_r. (hdestroy_r): Rename to __hdestroy_r and define as weak alias of __hdestroy_r. (hsearch_r): Rename to __hsearch_r and define as weak alias of __hsearch_r. * conform/Makefile (test-xfail-XPG3/search.h/linknamespace): Remove variable. (test-xfail-XPG4/search.h/linknamespace): Likewise. (test-xfail-UNIX98/search.h/linknamespace): Likewise. (test-xfail-XOPEN2K/search.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/search.h/linknamespace): Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/search.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/search.h b/include/search.h
index cf9c343708..24eafc0f71 100644
--- a/include/search.h
+++ b/include/search.h
@@ -2,9 +2,12 @@
#include <misc/search.h>
#ifndef _ISOMAC
-libc_hidden_proto (hcreate_r)
-libc_hidden_proto (hdestroy_r)
-libc_hidden_proto (hsearch_r)
+extern __typeof (hcreate_r) __hcreate_r;
+libc_hidden_proto (__hcreate_r)
+extern __typeof (hdestroy_r) __hdestroy_r;
+libc_hidden_proto (__hdestroy_r)
+extern __typeof (hsearch_r) __hsearch_r;
+libc_hidden_proto (__hsearch_r)
libc_hidden_proto (lfind)
/* Now define the internal interfaces. */