diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-06-05 23:32:46 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-06-05 23:32:46 +0000 |
commit | 711f67a789ba3505ae7b071453763e06590aa245 (patch) | |
tree | bebc9585cae79303cbb3ee19ac0db78aa3167fdd /libio/memstream.c | |
parent | a5f0adb39b3a029b3fcd1b0d879eb45d9bd742cd (diff) | |
download | glibc-711f67a789ba3505ae7b071453763e06590aa245.tar glibc-711f67a789ba3505ae7b071453763e06590aa245.tar.gz glibc-711f67a789ba3505ae7b071453763e06590aa245.tar.bz2 glibc-711f67a789ba3505ae7b071453763e06590aa245.zip |
Fix open_memstream namespace (bug 18498).
open_memstream is new in the 2008 edition of POSIX. However, the
older functions getopt, closelog and fmtmsg all bring in references to
it. This patch fixes this in the usual way, making open_memstream
into a weak alias of __open_memstream and calling __open_memstream
from the relevant places.
Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch). 32-bit builds
produce an XPASS for conform/POSIX/unistd.h/linknamespace after this
patch (because the only cause of failure left there now is 64-bit
specific); that will disappear once the 64-bit failure is resolved and
the XFAIL removed at that time.
[BZ #18498]
* libio/memstream.c (open_memstream): Rename to __open_memstream
and define as weak alias of __open_memstream.
* include/stdio.h (__open_memstream): Declare. Use
libc_hidden_proto.
(open_memstream): Don't use libc_hidden_proto.
* misc/syslog.c (__vsyslog_chk): Call __open_memstream instead of
open_memstream.
* posix/getopt.c (_getopt_internal_r): Likewise.
* conform/Makefile (test-xfail-XPG3/stdio.h/linknamespace): Remove
variable.
(test-xfail-XPG4/stdio.h/linknamespace): Likewise.
(test-xfail-UNIX98/stdio.h/linknamespace): Likewise.
(test-xfail-XOPEN2K/unistd.h/linknamespace): Likewise.
Diffstat (limited to 'libio/memstream.c')
-rw-r--r-- | libio/memstream.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libio/memstream.c b/libio/memstream.c index 81bfe6dd67..84742d1236 100644 --- a/libio/memstream.c +++ b/libio/memstream.c @@ -61,7 +61,7 @@ static const struct _IO_jump_t _IO_mem_jumps = necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ _IO_FILE * -open_memstream (bufloc, sizeloc) +__open_memstream (bufloc, sizeloc) char **bufloc; _IO_size_t *sizeloc; { @@ -100,7 +100,8 @@ open_memstream (bufloc, sizeloc) return (_IO_FILE *) &new_f->fp._sf._sbf; } -libc_hidden_def (open_memstream) +libc_hidden_def (__open_memstream) +weak_alias (__open_memstream, open_memstream) static int |