diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2014-06-09 16:19:25 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.com> | 2015-07-08 12:07:21 -0300 |
commit | fdb7d390dd0d96e4a8239c46f3aa64598b90842b (patch) | |
tree | adab2a28bad088043828d25b5c6bf83a5612fba7 /sysdeps/unix | |
parent | 1c1e3125206ef810dc7282023f6267a33b486233 (diff) | |
download | glibc-fdb7d390dd0d96e4a8239c46f3aa64598b90842b.tar.gz glibc-fdb7d390dd0d96e4a8239c46f3aa64598b90842b.tar.xz glibc-fdb7d390dd0d96e4a8239c46f3aa64598b90842b.zip |
libio: fmemopen rewrite to POSIX compliance
This patch added a new fmemopen version, for glibc 2.22, that aims to be POSIX complaint. It fixes some long-stading glibc fmemopen issues, such as: * it changes the way fseek with SEEK_END works on fmemopen to seek relative to buffer size instead of first '\0'. This is default mode and 'b' opening mode does not change internal behavior (bz#6544). * fix apending opening mode to use as start position either first null byte of len specified in function call (bz#13152 and #13151). * remove binary option 'b' and internal different handling (bz#12836) * fix seek/SEE_END with negative values (bz#14292). A compatibility symbol is provided to with old behavior for older symbols version (2.2.5). * include/stdio.h (fmemopen): Remove hidden prototype. (__fmemopen): Add new hidden prototype. * libio/Makefile: Add oldfmemopen object. * libio/Versions [GLIBC_2.22]: Add new fmemopen symbol. * libio/fmemopen.c (__fmemopen): Function rewrite to be POSIX compliance. * libio/oldfmemopen.c: New file: old fmemopen implementation for symbol compatibility. * stdio-common/Makefile [tests]: Add new tst-fmemopen3. * stdio-common/psiginfo.c [psiginfo]: Call __fmemopen instead of fmemopen. * stdio-common/tst-fmemopen3.c: New file: more fmemopen tests, focus on append and read mode. * sysdeps/unix/sysv/linux/aarch64/libc.abilist [GLIBC_2.22]: Add fmemopen. * sysdeps/unix/sysv/linux/alpha/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist [GLIBC_2.22]: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist [GLIBC_2.22]: Likewise.
Diffstat (limited to 'sysdeps/unix')
27 files changed, 81 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index aeee312289..3e0f329471 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2081,3 +2081,6 @@ GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F _mcount F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 980e08857a..58c8b32dac 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -1822,6 +1822,9 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.2 GLIBC_2.2 A _IO_adjust_wcolumn F diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist index ce45208b5f..f2b20ad6d6 100644 --- a/sysdeps/unix/sysv/linux/arm/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/libc.abilist @@ -89,6 +89,9 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.4 GLIBC_2.4 A _Exit F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 58407fcbb4..cf0ad90275 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -95,6 +95,9 @@ GLIBC_2.18 GLIBC_2.19 GLIBC_2.19 A fanotify_mark F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.2 GLIBC_2.2 A _Exit F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 3cb314ddfc..fcf1b72ab5 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2023,6 +2023,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 067552d175..16c2e3d4bc 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1881,6 +1881,9 @@ GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F getunwind F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index f06cc8ef8b..902b0c30c5 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -90,6 +90,9 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.4 GLIBC_2.4 A _Exit F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 9010ea733b..4db00b0454 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -1979,6 +1979,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist index 6e8d993ac6..f1f76a1416 100644 --- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist @@ -2080,3 +2080,6 @@ GLIBC_2.18 xencrypt F xprt_register F xprt_unregister F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 1c3490cdeb..2d51989b4f 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -1951,6 +1951,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index d8fd82393f..b012bdfec8 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -1949,6 +1949,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 3e6ed351b6..9db0e8b43c 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -1947,6 +1947,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index c7e46aa869..eecfcfed80 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -1941,6 +1941,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 0703418082..b10bf62432 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2121,3 +2121,6 @@ GLIBC_2.21 xencrypt F xprt_register F xprt_unregister F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index f27b48b3c6..0f1546399b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -1983,6 +1983,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index a54382e43d..7bcaa07698 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -1989,6 +1989,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist index 195b58757b..e58a00d939 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist @@ -90,6 +90,9 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A _Exit F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 0194f0b086..0ce7824046 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -1984,6 +1984,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 807f702981..dc79912bb0 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1880,6 +1880,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist index a653292c24..9ed1b45dc9 100644 --- a/sysdeps/unix/sysv/linux/sh/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/libc.abilist @@ -1864,6 +1864,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 9defbdf133..5a40ff3296 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -1975,6 +1975,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 35987faa6e..fa70645c98 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1908,6 +1908,9 @@ GLIBC_2.2.4 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist index caf74b89e1..dd215d747c 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist @@ -2091,3 +2091,6 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist index 68d975be55..ef4747a6e6 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist @@ -2091,3 +2091,6 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist index caf74b89e1..dd215d747c 100644 --- a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist @@ -2091,3 +2091,6 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 914b5908f0..b377b04e48 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1854,6 +1854,9 @@ GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.2.6 A __nanosleep F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F GLIBC_2.3 GLIBC_2.3 A __ctype_b_loc F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 0f64c8d20f..5f7032980b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2089,3 +2089,6 @@ GLIBC_2.17 GLIBC_2.18 GLIBC_2.18 A __cxa_thread_atexit_impl F +GLIBC_2.22 + GLIBC_2.22 A + fmemopen F |