This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] fmemopen posix compliance

Hi all,

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
the testcases.

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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]