This is the mail archive of the
mailing list for the glibc project.
[RFC] fmemopen posix compliance
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Wed, 11 Jun 2014 18:37:21 -0300
- Subject: [RFC] fmemopen posix compliance
- Authentication-results: sourceware.org; auth=none
It is known that GLIBC fmemopen differs from POSIX definition from some time,
in fact it predates POSIX standard. However, differences now has reached a
point that both differ in many points, leading to various bug reports:
fmemopen_seek() incorrectly inverses seek offset when using SEEK_END
fmemopen does not honor append mode
fmemopen streams fail to read eof
fmemopen returns NULL when len=0
fmemopen(buf,size,"w+b") isn't binary
fseek(..., 0, SEEK_END) doesn't work as it should on fmemopen's FILE
* From last POSIX definition, I say bz#11216 is not a GLIBC defect anymore and I
think it should be closed.
And currently I see there is no point of providing an unique implementation
now that POSIX has a working fmemopen definition. So I propose by placing current
implementation in a versioned symbol and adding a POSIX compliance one for
GLIBC 2.20 and forward.
Current fmemopen POSIX definition is:
The following two patches implements the new POSIX compliant fmemopen and adjust
Since it is RFC email, I haven't added CL to the patches neither update the documentation.
If we decide that using a POSIX compliant fmemopen is the way we want for GLIBC 2.20,
I will update the patch with the missing points.