3 ms·
In gnulib, there is code that patches FILE internals for various platforms to modify behavior of <stdio.h> functions, or implement new functionality. https://c
by fweimer 1y ago
In gnulib, there is code that patches FILE internals for various platforms to modify behavior of <stdio.h> functions, or implement new functionality.
https://cgit.git.savannah.gnu.org/cgit/gnulib.git/tree/lib/stdio-impl.h https://cgit.git.savannah.gnu.org/cgit/gnulib.git/tree/lib/s...
Yes, it's not a good idea to do this. There are more questionable pieces in gnulib, like closing stdin/stdout/stderr (because fflush and fsync is deemed too slow, and regular close reports some errors on NFS on some systems that would otherwise go unreported).
- collinfunk 1y agoYes, that part of Gnulib has caused some problems previously. It is mostly used to implement <stdio_ext.h> functions on non-glibc systems. However, it is also needed for some buggy implementations of ftello, fseeko, and fflush. P.S. Hi Florian :)
- collinfunk 1y agoAnd now updated for this change. https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=69a02b5307df043ca22c4b75eaec12be21493910 https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=69a0...
- quotemstr 1y ago> Yes, it's not a good idea to do this. There are more questionable pieces in gnulib, like closing stdin/stdout/stderr (because fflush and fsync is deemed too slow, and regular close reports some errors on NFS on some systems that would otherwise go unreported). Hyrum's law strikes again. People cast dl_info and poke at internal bits all the time too. glibc and others should be using kernel-style compiler-driven struct layout randomization to fight it.
- jancsika 1y ago> Hyrum's law strikes again. Is there a name for APIs that are drawn directly from some subset of observed behaviors? Like Crockford going, "Hey, there's a nice little data format buried in these JS objects. Schloink"
- quotemstr 1y ago> Is there a name for APIs that are drawn directly from some subset of observed behaviors? Desire paths. https://en.wikipedia.org/wiki/Desire_path https://en.wikipedia.org/wiki/Desire_path